1 | <?php |
||
11 | class TenantPolicy |
||
12 | { |
||
13 | use HandlesAuthorization; |
||
14 | |||
15 | /** |
||
16 | * Determine whether the user can list tenants. |
||
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 tenants. |
||
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 tenant. |
||
43 | * |
||
44 | * @param string $ability |
||
45 | * @param \Rinvex\Fort\Models\User $user |
||
46 | * @param \Rinvex\Tenants\Models\Tenant $resource |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function update($ability, User $user, Tenant $resource): bool |
||
54 | |||
55 | /** |
||
56 | * Determine whether the user can delete the tenant. |
||
57 | * |
||
58 | * @param string $ability |
||
59 | * @param \Rinvex\Fort\Models\User $user |
||
60 | * @param \Rinvex\Tenants\Models\Tenant $resource |
||
61 | * |
||
62 | * @return bool |
||
63 | */ |
||
64 | public function delete($ability, User $user, Tenant $resource): bool |
||
68 | |||
69 | /** |
||
70 | * Determine whether the user can list tenant media. |
||
71 | * |
||
72 | * @param string $ability |
||
73 | * @param \Rinvex\Fort\Models\User $user |
||
74 | * |
||
75 | * @return bool |
||
76 | */ |
||
77 | public function listMedia($ability, User $user): bool |
||
81 | |||
82 | /** |
||
83 | * Determine whether the user can create tenant media. |
||
84 | * |
||
85 | * @param string $ability |
||
86 | * @param \Rinvex\Fort\Models\User $user |
||
87 | * |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function createMedia($ability, User $user): bool |
||
94 | |||
95 | /** |
||
96 | * Determine whether the user can delete the tenant media. |
||
97 | * |
||
98 | * @param string $ability |
||
99 | * @param \Rinvex\Fort\Models\User $user |
||
100 | * @param \Rinvex\Tenants\Models\Tenant $resource |
||
101 | * |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function deleteMedia($ability, User $user, Tenant $resource): bool |
||
108 | } |
||
109 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.