| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 2 |
| CRAP Score | 4.125 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function update(User $user, User $model) |
||
| 28 | 11 | { |
|
| 29 | if($this->checkPermission($user, 'Manage Users')) |
||
| 30 | 11 | { |
|
| 31 | // If they user has permission to Manage Users, they cannot manage anyone with a higher role than themselves |
||
| 32 | if($user->role_id > $model->role_id) |
||
| 33 | { |
||
| 34 | return Response::deny('You cannot modify a user with higher permissions than yourself'); |
||
| 35 | } |
||
| 36 | |||
| 37 | return true; |
||
| 38 | } |
||
| 39 | |||
| 40 | return $user->user_id === $model->user_id; |
||
| 41 | } |
||
| 59 |