Conditions | 4 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function authorize(): bool |
||
20 | { |
||
21 | $currentUser = $this->user($this->route('guard')); |
||
22 | |||
23 | if (optional($this->route('ability'))->exists && ! $currentUser->can('superadmin') && ! $currentUser->getAbilities()->contains($this->route('ability'))) { |
||
|
|||
24 | throw new GenericException(trans('cortex/auth::messages.action_unauthorized'), route('adminarea.abilities.index')); |
||
25 | } |
||
26 | |||
27 | return true; |
||
28 | } |
||
29 | |||
40 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.