Skip to content

Commit

Permalink
skip check if role has access to all routes (e.g. admin)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Jan 22, 2022
1 parent 4f03e51 commit 5c4f861
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ trait IsResourceOwnerTrait
*/
public function isResourceOwner(): bool
{
if ($this->user()->hasAnyRole(config('apiato.requests.allow-roles-to-access-all-routes'))) {
return true;
}

return hash_equals((string)$this->user()->getKey(), (string)$this->id);
}
}

0 comments on commit 5c4f861

Please sign in to comment.