Skip to content

Commit

Permalink
Merge pull request #75 from Aniruddh-J/patch-2
Browse files Browse the repository at this point in the history
Refer to policy before checking user role
  • Loading branch information
rupadana authored Oct 23, 2024
2 parents d0bef34 + 490c82f commit 373e2bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Resources/TokenResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public static function form(Form $form): Form
->hidden(function () {
$user = auth()->user();

$policy = config('api-service.models.token.enable_policy', true);

if ($policy === false) return false;

return ! $user->hasRole('super_admin');
})
->required(),
Expand Down

0 comments on commit 373e2bc

Please sign in to comment.