Skip to content

Commit

Permalink
Fix permission scopes to work with SuperAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebronner committed Feb 23, 2020
1 parent a23a91b commit 6ebb138
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Traits/Governable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ protected function applyPermissionToQuery(Builder $query, string $ability) : Bui

protected function filterQuery(Builder $query, Collection $ownerships) : Builder
{
if ($ownerships->contains("any")) {
if ($ownerships->contains("any")
|| auth()->user()->hasRole("SuperAdmin")
) {
return $query;
}

Expand Down

0 comments on commit 6ebb138

Please sign in to comment.