Skip to content

Clear wildcard permission index when assigning or removing roles - #2925

Merged
freekmurze merged 1 commit into
spatie:mainfrom
freekmurze:fix/clear-wildcard-index-on-role-change
Feb 22, 2026
Merged

Clear wildcard permission index when assigning or removing roles#2925
freekmurze merged 1 commit into
spatie:mainfrom
freekmurze:fix/clear-wildcard-index-on-role-change

Conversation

@freekmurze

Copy link
Copy Markdown
Member

Summary

  • Clears the wildcard permission index in assignRole() and removeRole(), fixing stale cached permission results when wildcard permissions are enabled
  • Adds two tests that verify the index is properly invalidated on role changes

Fixes #2725

When wildcard permissions are enabled, the permission index was not
being cleared on assignRole() and removeRole(), causing stale cached
results when permissions were checked before and after role changes.

Fixes spatie#2725

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@freekmurze
freekmurze merged commit 4b2572e into spatie:main Feb 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wildcard Permissions are not updated once assigned a role

1 participant