github spatie/laravel-permission 8.2.0

5 hours ago

What's Changed

  • Fire PermissionDetachedEvent when syncing permissions (symmetry with syncRoles) by @chengkangzai in #2963
  • Fixed a bug where removing a role or permission from a model on one team could also remove that same assignment on other teams, when the model uses a custom pivot class (->using(CustomPivot::class)) on roles()/permissions() with teams enabled. (Issue #2867) by @drbyte in #2961

Watch out for in your own test suite:

  • If you use custom pivot model deleting/deleted hooks to react to role/permission removal under teams, those hooks were already unreliable in this scenario and remain out of scope — switch to listening for RoleDetachedEvent / PermissionDetachedEvent instead.
  • revokePermissionTo() can now throw GuardDoesNotMatch in rare cases where it previously wouldn't have, as a side effect of routing through the same guard-check used by givePermissionTo(). This should not affect normal usage (permissions being revoked are already guard-matched), but if your tests exercise unusual multi-guard setups, re-run them against this release.

Full Changelog: 8.1.0...8.2.0

Don't miss a new laravel-permission release

NewReleases is sending notifications on new releases.