Conditions | 4 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function authorize(): bool |
||
23 | { |
||
24 | $currentUser = $this->user($this->route('guard')); |
||
25 | |||
26 | if (optional($this->route('ability'))->exists && ! $currentUser->can('superadmin') && ! $currentUser->getAbilities()->contains($this->route('ability'))) { |
||
|
|||
27 | throw new GenericException(trans('cortex/auth::messages.action_unauthorized'), route('adminarea.abilities.index')); |
||
28 | } |
||
29 | |||
30 | return true; |
||
31 | } |
||
32 | |||
56 |
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.