Skip to content

Commit

Permalink
Merge pull request #381 from bezhanSalleh/fix/super-admin-role
Browse files Browse the repository at this point in the history
[Fix] Not generate `super_admin` role when disabled
  • Loading branch information
bezhanSalleh authored May 14, 2024
2 parents 2e30ae1 + 4ecc790 commit aa1046d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FilamentShield.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function generateForWidget(string $widget): void

protected static function giveSuperAdminPermission(string | array | Collection $permissions): void
{
if (! Utils::isSuperAdminDefinedViaGate()) {
if (! Utils::isSuperAdminDefinedViaGate() && Utils::isSuperAdminEnabled()) {
$superAdmin = static::createRole();

$superAdmin->givePermissionTo($permissions);
Expand Down

0 comments on commit aa1046d

Please sign in to comment.