apavliukov/laravel-authorization
A Laravel authorization package for defining and enforcing access rules. It helps organize roles, permissions, and policy-style checks so you can control which users can perform actions in your application.
BelongsToTenant retaining TenantScope during Eloquent model restoration for Livewire props and SerializesModels jobs) is untouched by this release, as is strict mode and the MissingTenantContextException / ModelNotFoundException behavior. The ship-blocker upgrade decision still stands; v1.6.0 is adoptable on the same grounds, not a replacement for it.oohire and opiny both use — single-database organizations, roles inside them, and a platform admin. Adopt it for that core; explicitly plan to own the periphery. Any roadmap item that assumed "the package handles it" needs re-checking against the removal list.TeamResolver, DefaultTeamResolver, CallbackTeamResolver, SetPermissionsTeam, and resolveTeamsUsing() are removed. If the roadmap includes a workspace/teams product without strict tenancy, the app must call setPermissionsTeamId() from its own middleware (SetCurrentTenant covers the tenanted path). Size this before committing to such a feature; don't scope it as "free."BypassStrategy, RoleBypass, NoBypass, BypassGate, and bypassUsing() are removed in favor of one Gate::before rule (super-admin passes — under teams only the global assignment counts — everyone else falls through, never false). Support-tool impersonation, partner API service accounts, or break-glass admin flows are now our implementation and our security review.userCan() is now plain $user->can(); UserPermissionMemo and forgetUserPermissions() are removed (role-read memoization and forgetUserRoles() remain). Before rollout, load-test admin list/detail screens and any high-cardinality permission checks; a p95 regression here is a customer-visible product issue, and app-level caching becomes our cost.Tenancy\CurrentArea, authorization.areas, the Livewire original-route hook, plus the 1.5.0 enterable_scope / fallback_to_owned / TenantResolver::choose() knobs are all removed. The resolver still drops a gone or soft-deleted tenant and picks the user's sole existing one. Net: less out-of-the-box behavior, more control — narrower picker rules (active-only, owned-first, remembered area) become a deliberate product design task in the switcher rather than a config flag.authorization:sync, authorization:repair-ownership, and make:authorization-policy are removed along with PermissionSync::plan() / apply(prune: true). AuthorizationSeeder still syncs permissions and roles and re-derives owner rows on every run — confirm seeding is in the deploy path and remove any pipeline step calling the deleted commands, or releases will fail at deploy time.forTenant(), withoutTenant(), strict) rather than ambient.strict.For executives: Two things are true at once. First, the security position is intact: the tenant-isolation fix we prioritized in v1.4.0 is unaffected by this release, so our documented guarantee that model restoration and queued-job hydration respect tenant boundaries still holds and can still go in front of enterprise buyers and security reviewers. Second, this release deliberately shrinks the package to only what its author's two applications use — it removes team handling without tenancy, custom authorization bypass, permission-check memoization, UI area state, tenant-picker tuning, and the permission-sync CLI. That is good for surface area and bad for our total cost of ownership: those capabilities become our code if we want them. Practically, the upgrade is a bounded refactor with no database migrations and no change to the remaining behavior: drop three config keys, replace a handful of symbol references, and remove deleted commands from deploy scripts. Recommendation: take the upgrade, pin the version, and fund two small hardening items — a load test on permission-heavy admin screens now that verdict memoization is gone, and contract tests around the symbols we depend on, because this package removes public API in minor releases by design. The strategic read is that we are depending on a well-maintained internal library, not a broadly supported open-source product; plan accordingly.
For engineering: Upgrade to v1.6.0 on top of the v1.4.0 baseline. Tenancy behavior (BelongsToTenant / TenantScope on restore, strict mode) is unchanged; there are no migrations. Work items: (1) remove enterable_scope, fallback_to_owned, and areas from any published config/authorization.php; (2) replace removed symbols — oohire touches ProviderWiringTest's BypassStrategy assertion and Support\Areas's CurrentArea::SESSION_KEY (needs its own session key), laravel-starter touches CurrentLayout's CurrentArea; (3) if any code path relied on teams without tenancy, add middleware calling setPermissionsTeamId(); (4) if you relied on a custom bypass, implement it in app code — the provider now registers a single Gate::before where super-admin passes (under teams, only the global assignment counts) and everyone else falls through, never false; (5) userCan() is now $user->can(), so benchmark permission-heavy screens and add app-level caching where needed; (6) define system-ability gates explicitly as Gate::define(SystemAbility::X->value, static fn (): bool => false) since systemAbilities() is gone; (7) TenantScopedPolicy now compares Tenancy::id() against the model's tenancy.foreign_key, so verify policy tests reflect that; (8) audit deploy pipelines for authorization:sync, authorization:repair-ownership, and make:authorization-policy and rely on AuthorizationSeeder for permission/role sync and owner-row re-derivation. Keep the regression tests covering restore-after-tenant-switch from the 1.4.0 rollout, and add a smoke test that boots the app with the trimmed config to catch stale keys.
How can I help you explore Laravel packages today?