| Conditions | 4 |
| Paths | 2 |
| Total Lines | 10 |
| 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('role'))->exists && ! $currentUser->can('superadmin') && ! $currentUser->roles->contains($this->route('role'))) { |
||
|
|
|||
| 27 | throw new GenericException(trans('cortex/auth::messages.action_unauthorized'), route('adminarea.roles.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.