hosseinhezami/laravel-permission-manager
Enterprise-grade Laravel permission manager combining RBAC, ABAC, role hierarchy, multi-tenancy, wildcard and temporary permissions, condition engine, multi-guard support, audit logging, middleware DSL, Blade directives, and Gate/Policy integration.
Build vs. buy for authorization infrastructure. Authorization is a "must-have, never a differentiator" capability. This package bundles several features that teams typically build in-house over multiple sprints — explicit allow/deny precedence, role hierarchy with cycle detection, wildcard matching, time-boxed permissions, team-scoped roles, JSON condition rules, and audit logging — into a single dependency. The decision it informs is whether to spend engineering weeks on bespoke authorization or adopt a pre-built engine and spend that capacity on customer-facing features.
Feature feasibility on the roadmap. Capabilities that are expensive to add later map directly to roadmap commitments:
permission_audits, authorization_logs) and role hierarchy are frequently explicit security questionnaire requirements. This package makes them a configuration task rather than a quarter-long project.assignRoleForTeam) is the difference between "we can serve multi-tenant customers" and "we need an architecture rewrite." If multi-tenancy is on the 2–4 quarter horizon, this is a strong accelerator.canPermission('posts.update', $post) with ownership/status conditions) enables product rules like "editors can only edit their own drafts" without hardcoding policy logic per model.Support and incident-response decisions. The explain() API, permission:why, and permission:doctor commands materially reduce the cost of "why can't this user see this?" support tickets — a recurring, hard-to-estimate operational tax in any RBAC system. This is a quality-of-life lever, not a headline feature, but it influences on-call load.
Buy-in sizing for security/compliance reviews. The explicit, documented resolution order (super-admin → user deny → role deny → user allow → role allow → inherited → default deny) is the artifact security reviewers ask for. Having a written precedence model shortens audit cycles.
What it does not decide. It is not a reason to re-architect an existing, working authorization layer. It does not replace Laravel's Gate/Policy system — it integrates with it, so the migration cost is additive, not substitutive.
Good fit:
Look elsewhere or proceed with caution:
laravel-permission has orders of magnitude more installs, Stack Overflow coverage, and community answers. For a foundational, security-adjacent layer, that asymmetry matters more than the feature list.User models, tenancy, and reporting queries. Rolling it back after 12 months of production data is a real project, not a composer remove.Gate to adoption: Run a two-day spike — install, model your three most complex real authorization rules, and verify them against the test suite. Treat a successful spike plus a written exit/migration plan as the go/no-go criteria.
To executives and product leadership:
Authorization is table-stakes infrastructure that currently costs us engineering weeks and generates recurring support load. This package provides enterprise-grade capability — role hierarchies, per-tenant roles, time-limited access, contextual rules, and a full audit trail — as a single MIT-licensed dependency. It directly unblocks two things we've discussed: enterprise/regulated deals that require audit trails, and multi-tenant SaaS expansion. The trade-off is real: it's a young library with limited public adoption and a single maintainer, so we'd adopt it behind an internal test suite, pin the version, and keep a documented exit path. Recommendation: timeboxed spike now; adopt if it clears our own test matrix.
To engineering:
Feature-for-feature, this is what we'd build in 4–6 sprints: RBAC plus explicit deny precedence, role inheritance with cycle detection, wildcard matching, temporary permissions, team-scoped roles, a JSON condition engine (no
eval), and audit logging. It integrates with native Gate/Policy viaGate::before()rather than replacing them, so we're not fighting the framework. It ships 141 tests / 226 assertions, a documented resolution order, and genuinely useful operator tooling —permission:doctor,permission:why, and anexplain()API that turns permission-debugging from log archaeology into a one-liner. Costs: 14 new tables, aPermissionTraiton the User model, and a dependency we must own. Ask: spike it against our three hairiest authorization rules and report back on migration friction, query overhead under caching, and upgrade risk.
To security and compliance:
The package exposes an explicit, documented authorization precedence model, writes an immutable audit record for permission changes, and optionally logs access attempts. Roles are scoped per team/guard, and permission grants can be time-boxed with automatic expiry — which supports least-privilege and temporary-elevation policies. Caveat for your review: it is a young, single-maintainer project with no known production dependents, so we will require internal test coverage on the authorization paths and a pinned version with a monitored advisory feed before it goes near production.
How can I help you explore Laravel packages today?