diff --git a/src/Resources/TokenResource.php b/src/Resources/TokenResource.php index 9c0c913..daff2d7 100644 --- a/src/Resources/TokenResource.php +++ b/src/Resources/TokenResource.php @@ -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(),