8000 fix: Invalidate permissions cache if group assignment of user changes by fsbraun · Pull Request #7963 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

fix: Invalidate permissions cache if group assignment of user changes #7963

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

Merged

Conversation

fsbraun
Copy link
Member
@fsbraun fsbraun commented Jul 21, 2024

Description

This PR fixes #7962.

When the user is assigned or unassigned from a group, not the pre_save signal is fired but the m2m_changed signal. This, up to now, has not been caught by django CMS.

This PR adds a receiver for the m2m_changed signal and invalidates the permissions cache for the user.

Both adding a group to a user or removing a group to a user are tested.

Related resources

Checklist

  • I have opened this pull request against develop-4
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined the channel #pr-reviews on our Discord Server to find a “pr review buddy” who is going to review my pull request.

@fsbraun fsbraun added the needs to be backported Commits need to be backported label Jul 21, 2024
@fsbraun fsbraun requested a review from a team July 21, 2024 11:16
@fsbraun
Copy link
Member Author
fsbraun commented Jul 21, 2024

@jrief Can you have a look at this? You're using permissions quite regularly, right?

@fsbraun fsbraun requested a review from jrief July 21, 2024 11:18
@fsbraun fsbraun force-pushed the fix/permission-cache-invalidation branch from fc59f73 to 1240e18 Compare July 21, 2024 11:19
@fsbraun fsbraun merged commit 43f8b71 into django-cms:develop-4 Jul 23, 2024
32 checks passed
@fsbraun fsbraun deleted the fix/permission-cache-invalidation branch July 23, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs to be backported Commits need to be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] About the refresh of the page permission cache
2 participants
0