Skip to content

Commit

Permalink
Checking the "viewHorizon" gate first (#1148)
Browse files Browse the repository at this point in the history
Checking the "viewHorizon" gate first before checking if its local environment.
  • Loading branch information
marcialpaulg committed Apr 20, 2022
1 parent 2ae1d39 commit a981507
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/HorizonApplicationServiceProvider.php
Expand Up @@ -27,8 +27,7 @@ protected function authorization()
$this->gate();

Horizon::auth(function ($request) {
return app()->environment('local') ||
Gate::check('viewHorizon', [$request->user()]);
return Gate::check('viewHorizon', [$request->user()]) || app()->environment('local');
});
}

Expand Down

0 comments on commit a981507

Please sign in to comment.