1 | <?php |
||
11 | class RolePolicy |
||
12 | { |
||
13 | use HandlesAuthorization; |
||
14 | |||
15 | /** |
||
16 | * Determine whether the user can list roles. |
||
17 | * |
||
18 | * @param string $ability |
||
19 | * @param \Rinvex\Fort\Models\User $user |
||
20 | * |
||
21 | * @return bool |
||
22 | */ |
||
23 | public function list($ability, User $user): bool |
||
27 | |||
28 | /** |
||
29 | * Determine whether the user can create roles. |
||
30 | * |
||
31 | * @param string $ability |
||
32 | * @param \Rinvex\Fort\Models\User $user |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function create($ability, User $user): bool |
||
40 | |||
41 | /** |
||
42 | * Determine whether the user can update the role. |
||
43 | * |
||
44 | * @param string $ability |
||
45 | * @param \Rinvex\Fort\Models\User $user |
||
46 | * @param \Rinvex\Fort\Models\Role $resource |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function update($ability, User $user, Role $resource): bool |
||
57 | |||
58 | /** |
||
59 | * Determine whether the user can delete the role. |
||
60 | * |
||
61 | * @param string $ability |
||
62 | * @param \Rinvex\Fort\Models\User $user |
||
63 | * @param \Rinvex\Fort\Models\Role $resource |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function delete($ability, User $user, Role $resource): bool |
||
76 | |||
77 | /** |
||
78 | * Determine whether the user can assign the given role to the given user. |
||
79 | * |
||
80 | * @param string $ability |
||
81 | * @param \Rinvex\Fort\Models\User $user |
||
82 | * @param \Rinvex\Fort\Models\Role $resource |
||
83 | * @param \Rinvex\Fort\Models\User $resourced |
||
84 | * |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function assign($ability, User $user, Role $resource, User $resourced): bool |
||
94 | } |
||
95 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.