Skip to content

v0.1.0 — Spatie permission adapter

Choose a tag to compare

@sylvesterdamgaard sylvesterdamgaard released this 24 Jul 21:17

First release. Lets an app that already uses `spatie/laravel-permission` adopt Cbox ID for AuthN/SSO/OAuth/OIDC/SCIM while Spatie stays the source of roles, permissions, and token claims. Requires `cboxdk/laravel-id` >= 0.50 (external access-control driver).

Provides

  • `SpatieAccessChecker` (read path) — `can()`/`permissionsFor()`/`forToken()` resolve from Spatie's effective (direct + role-derived) permissions and roles; unknown permission or subject denies rather than errors.
  • `SpatieRoles` (write path for SCIM + governance) — `define`/`grantPermission`/`assign`/`unassign` drive into Spatie; `assignmentsForSubject`/`assignmentsInOrganization` return the platform's contract shapes so certification campaigns and SoD scans work.
  • `SpatieSubject` contract — a one-line `implements` on the host's `HasRoles` model.
  • Organization scoping via Spatie teams (org id = team id); flat when teams off.
  • Provider binds only under `access_control.driver=external`, so the two RBACs never collide.

Honest scope

Shared users-table id assumption; grant source always `manual`; `GroupRoleMappings` (SCIM group→role bridge) not shipped (deny-by-default; docs show how to add); default Spatie models only.

Dogfooded against a real Spatie 8.x install (teams on and off): 16 tests. Full gate green — Pint, PHPStan (level max), Pest, license-check, composer audit, SBOM.