1 | <?php |
||
8 | abstract class Access implements AccessInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var \Sco\Admin\Contracts\ComponentInterface |
||
12 | */ |
||
13 | protected $component; |
||
14 | |||
15 | private $abilities = [ |
||
16 | 'view' => true, |
||
17 | 'create' => true, |
||
18 | 'edit' => true, |
||
19 | 'delete' => true, |
||
20 | 'destroy' => true, |
||
21 | 'restore' => true, |
||
22 | ]; |
||
23 | |||
24 | public function __construct(ComponentInterface $component) |
||
28 | |||
29 | public function isView() |
||
34 | |||
35 | public function isCreate() |
||
40 | |||
41 | public function isEdit() |
||
46 | |||
47 | public function isDelete() |
||
51 | |||
52 | public function isDestroy() |
||
56 | |||
57 | public function isRestore() |
||
61 | |||
62 | protected function isRestorableModel() |
||
66 | |||
67 | /** |
||
68 | * @param string $ability |
||
69 | * |
||
70 | * @return mixed |
||
71 | */ |
||
72 | final public function can($ability) |
||
86 | |||
87 | protected function getComponent() |
||
91 | } |
||
92 |