Skip to content

Commit

Permalink
Add EntityConfig deletable() option
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlpp committed May 31, 2016
1 parent b400c85 commit 4d8dff8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/cms/partials/list/delete-button.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@if(check_ability('delete', $category->key(), $entity->key(), $instance->id))
@if($entity->deletable() && check_ability('delete', $category->key(), $entity->key(), $instance->id))
<li>
{!! Form::open(["route"=>["sharp.cms.destroy", $category->key(), $entity->key(), $instance->id], "method"=>"DELETE", "id"=>"sharpdelete".$instance->id]) !!}
{!! Form::close() !!}
Expand Down
13 changes: 13 additions & 0 deletions src/Dvlpp/Sharp/Config/SharpEntityConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ abstract class SharpEntityConfig
*/
protected $creatable = true;

/**
* @var bool
*/
protected $deletable = true;

/**
* @var bool
*/
Expand Down Expand Up @@ -477,6 +482,14 @@ public function creatable()
return $this->creatable;
}

/**
* @return boolean
*/
public function deletable()
{
return $this->deletable;
}

/**
* @return boolean
*/
Expand Down

0 comments on commit 4d8dff8

Please sign in to comment.