Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 13 | public function before(User $user, $method) |
|
19 | { |
||
20 | 13 | $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q) |
|
21 | { |
||
22 | 13 | $q->where('description', 'Manage Equipment'); |
|
23 | 13 | })->first(); |
|
24 | |||
25 | 13 | Log::channel('auth')->debug('User '.$user->username.' is checking User Policy access to '.$method.'. Result - '.($allowed->allow ? 'Allow' : 'Deny')); |
|
26 | |||
27 | 13 | if($allowed->allow) |
|
28 | { |
||
29 | 7 | return $allowed->allow; |
|
30 | } |
||
68 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.