super_admin role generation
artjom opened this issue · comments
hey,
thanks for the great work!
It seems, there's a logic error for the super_admin role creation.
If the super_admin is disabled it still creates the super admin role, whenever a new policy is generated.
protected static function giveSuperAdminPermission(string | array | Collection $permissions): void { if (! Utils::isSuperAdminDefinedViaGate()) { $superAdmin = static::createRole(); $superAdmin->givePermissionTo($permissions); app(PermissionRegistrar::class)->forgetCachedPermissions(); } }
In my case, I don't need the super admin role at all, so I deactivated it in the config file. Still the role is added every time I'm generating a policy.