Releases: webrek/laravel-mongo-permission
Releases · webrek/laravel-mongo-permission
Release list
v1.6.1
Fixed
- Removed the property accessors added in 1.6.0 (
$role->permissions,$user->roles,$permission->roles, …). Undermongodb/laravel-mongodba same-named method is resolved as a relation, so accessing them as properties threwLogicException: … must return a relationship instance. Use the methods instead:$role->permissions(),$user->roles(),$role->users(),$permission->roles().
Added
- Tests for the inverse relation methods, including
Role::users()against both flat and structuredrole_ids.
v1.5.0
Changed
- Dropped Laravel 10/11 and PHP 8.1 (both past security support / no longer installable cleanly). Targets Laravel 12 / PHP 8.2+; composer.json, README and CI matrix aligned.
Fixed
- Deleting a role/permission now also removes legacy flat id references from users (not just structured subdocs) — no more orphaned ids.
- Cache invalidation on role/permission changes: editing/deleting a role or permission (incl. raw model saves, e.g. from an admin panel) now invalidates cached entries via a cache-generation bump. Previously
rememberForevercould leave permissions stale indefinitely.
Added
PermissionRegistrar::bumpCacheVersion()/cacheVersion(); cache key includes the generation.- Mutation testing (Infection) in CI (MSI ~88% / covered ~95%).
v1.4.0
Fixed
- Read assignments stored in the legacy flat form (a plain array of id strings, e.g. written by Maklad) in addition to the structured subdocument form. Previously
hasRole(),hasPermissionTo(),roles()andpermissions()returned nothing for users whoserole_ids/permission_idswere flat string arrays — causingrole:/permission:middleware to 403 those users. Both forms now coexist (legacy data works and is upgraded in place on assign). Applied acrossHasRoles,HasPermissionsandPermissionRegistrarvia a sharedSupport\\Entrynormaliser.
Added
Support\\Entryhelper normalising an entry (flat string or structured array) to{id, team_id, expires_at}.
Note
- Single-tenant apps (e.g. Metrix) should set
'teams' => falseinconfig/permission.php.