@@ -45,10 +45,10 @@ |
||
| 45 | 45 | { |
| 46 | 46 | $this->registerPolicies(); |
| 47 | 47 | |
| 48 | - Gate::define('index-dashboard', function ($user) { |
|
| 48 | + Gate::define('index-dashboard', function($user) { |
|
| 49 | 49 | return $user->isUser(); |
| 50 | 50 | }); |
| 51 | - Gate::define('index-activitylog', function ($user) { |
|
| 51 | + Gate::define('index-activitylog', function($user) { |
|
| 52 | 52 | return $user->isManager(); |
| 53 | 53 | }); |
| 54 | 54 | } |
@@ -28,10 +28,11 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function index(ActivityLogDataTable $dataTable) |
| 30 | 30 | { |
| 31 | - if (Gate::denies('index-activitylog')) |
|
| 32 | - throw new AuthorizationException("This action is unauthorized."); |
|
| 33 | - else |
|
| 34 | - return $dataTable->render('activitylog.index'); |
|
| 31 | + if (Gate::denies('index-activitylog')) { |
|
| 32 | + throw new AuthorizationException("This action is unauthorized."); |
|
| 33 | + } else { |
|
| 34 | + return $dataTable->render('activitylog.index'); |
|
| 35 | + } |
|
| 35 | 36 | } |
| 36 | 37 | |
| 37 | 38 | } |