1 | <?php namespace Arcanesoft\Blog\Policies; |
||
12 | class CategoriesPolicy extends Policy |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Constants |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | const PERMISSION_LIST = 'blog.categories.list'; |
||
20 | const PERMISSION_SHOW = 'blog.categories.show'; |
||
21 | const PERMISSION_CREATE = 'blog.categories.create'; |
||
22 | const PERMISSION_UPDATE = 'blog.categories.update'; |
||
23 | const PERMISSION_DELETE = 'blog.categories.delete'; |
||
24 | |||
25 | /* ----------------------------------------------------------------- |
||
26 | | Abilities |
||
27 | | ----------------------------------------------------------------- |
||
28 | */ |
||
29 | |||
30 | /** |
||
31 | * Allow to list all the categories. |
||
32 | * |
||
33 | * @param \Arcanesoft\Contracts\Auth\Models\User $user |
||
34 | * |
||
35 | * @return bool |
||
36 | */ |
||
37 | public function listPolicy(User $user) |
||
41 | |||
42 | /** |
||
43 | * Allow to show a category details. |
||
44 | * |
||
45 | * @param \Arcanesoft\Contracts\Auth\Models\User $user |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function showPolicy(User $user) |
||
53 | |||
54 | /** |
||
55 | * Allow to create a category. |
||
56 | * |
||
57 | * @param \Arcanesoft\Contracts\Auth\Models\User $user |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function createPolicy(User $user) |
||
65 | |||
66 | /** |
||
67 | * Allow to update a category. |
||
68 | * |
||
69 | * @param \Arcanesoft\Contracts\Auth\Models\User $user |
||
70 | * |
||
71 | * @return bool |
||
72 | */ |
||
73 | public function updatePolicy(User $user) |
||
77 | |||
78 | /** |
||
79 | * Allow to delete a category. |
||
80 | * |
||
81 | * @param \Arcanesoft\Contracts\Auth\Models\User $user |
||
82 | * |
||
83 | * @return bool |
||
84 | */ |
||
85 | public function deletePolicy(User $user) |
||
89 | } |
||
90 |