Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer flush cache on User role/perm assignment changes #1832

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

erikn69
Copy link
Contributor

@erikn69 erikn69 commented Aug 31, 2021

When User.php model uses removeRole, assignRole, revokePermissionTo, givePermissionTo, forgetCachedPermissions() is unnecessary because User is in memory, and it does not affect the cache data

src/Traits/HasRoles.php Outdated Show resolved Hide resolved
@drbyte drbyte changed the title Avoid unnecessary cache forget No longer flush cache on User role/perm assignment changes Aug 31, 2021
@drbyte drbyte merged commit 6ae0406 into spatie:main Aug 31, 2021
@erikn69 erikn69 deleted the fix_flush_cache branch September 2, 2021 14:49
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.

2 participants