| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class CustomerContactPolicy |
||
| 10 | { |
||
| 11 | use AllowTrait; |
||
|
1 ignored issue
–
show
|
|||
| 12 | use HandlesAuthorization; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Determine if the user can create a contact |
||
| 16 | */ |
||
| 17 | public function create(User $user) |
||
| 18 | { |
||
| 19 | 4 | return $this->checkPermission($user, 'Add Customer Contact'); |
|
| 20 | } |
||
| 21 | 4 | ||
| 22 | /** |
||
| 23 | * Determine if the user can update a contact |
||
| 24 | */ |
||
| 25 | public function update(User $user) |
||
| 26 | { |
||
| 27 | 4 | return $this->checkPermission($user, 'Edit Customer Contact'); |
|
| 28 | } |
||
| 29 | 4 | ||
| 30 | /** |
||
| 31 | * Determine if the user can delete a contact |
||
| 32 | */ |
||
| 33 | public function delete(User $user) |
||
| 34 | { |
||
| 35 | 3 | return $this->checkPermission($user, 'Delete Customer Contact'); |
|
| 36 | } |
||
| 37 | 3 | ||
| 38 | /** |
||
| 39 | * Determine if the user can restore a deleted contact |
||
| 40 | */ |
||
| 41 | public function restore(User $user) |
||
| 42 | { |
||
| 43 | 2 | return $this->checkPermission($user, 'Manage Customers'); |
|
| 44 | } |
||
| 45 | 2 | ||
| 46 | /** |
||
| 47 | * Determine if the user can permanently delete a contact |
||
| 48 | */ |
||
| 49 | public function forceDelete(User $user) |
||
| 52 | } |
||
| 53 | } |
||
| 54 |