elpandape/filament-permission
elpandape/filament-permission is a Filament plugin for managing roles and permissions in Laravel admin panels. It provides UI resources for creating roles, assigning permissions, and controlling access to Filament resources and pages, helping teams implement authorization quickly.
grants.unrestricted setting;PrivilegedRole class, especially the new isLastHolder() helper;PrivilegedRole::isLastHolder() before rendering detach controls and again inside the detach handler. Use it to disable buttons, filter bulk selections, and short-circuit API requests. Keep the server-side check even when the UI hides the action.grants.unrestricted does not bypass it. If you build custom “super admin” checks, check role membership or the package’s helper—not an unrestricted-permissions flag.canDetach, bulk detach visibility, and any “detach any” behavior. The default relation manager behavior may still offer broader detach options than the package’s grant/revoke rules; align them explicitly.grants.unrestricted is not a super-admin bypass: It may widen what a role can grant, but it does not satisfy the privileged-role check. Do not use it as a proxy for “can manage super admins.”isLastHolder() can become stale between rendering and submission. Re-check inside a transaction and, where possible, lock the relevant role assignments before detaching. Two concurrent removals of the last two holders are the dangerous case.isLastHolder() checks in the request path.canGrantRole and reuse it for both attach and detach decisions.How can I help you explore Laravel packages today?