Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

super_admin role generation #371

Closed
artjom opened this issue Apr 25, 2024 · 0 comments · Fixed by #381
Closed

super_admin role generation #371

artjom opened this issue Apr 25, 2024 · 0 comments · Fixed by #381
Labels
bug Something isn't working

Comments

@artjom
Copy link

artjom commented Apr 25, 2024

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.

@artjom artjom changed the title super_admin role super_admin role generation Apr 25, 2024
@bezhanSalleh bezhanSalleh added bug Something isn't working labels May 13, 2024
bezhanSalleh added a commit that referenced this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants