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 |
||
32 | public function update(User $user, User $model) |
||
33 | { |
||
34 | if($this->checkPermission($user, 'Manage Users')) |
||
35 | { |
||
36 | // If they user has permission to Manage Users, they cannot manage anyone with a higher role than themselves |
||
37 | if($user->role_id > $model->role_id) |
||
38 | { |
||
39 | return Response::deny('You cannot modify a user with higher permissions than yourself'); |
||
40 | } |
||
41 | |||
42 | return true; |
||
43 | 4 | } |
|
44 | |||
45 | 4 | return $user->user_id === $model->user_id; |
|
46 | } |
||
48 |