Skip to content

Prevent duplication of roles #1

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

Open
wants to merge 1 commit into
base: 3.0.x
Choose a base branch
from
Open

Conversation

Loreith
Copy link
Collaborator

@Loreith Loreith commented Feb 21, 2025

Description

Stops the runaway duplication of roles.

Previously when roles were loaded programmatically, any action to save would create duplicates of every role the user had in any domains other than the current one.

This patch simply checks that the role being added won't be a duplicate, so avoids potentially altering any existing business logic surrounding this.

Testing

This has been tested in the Australian Greens environment together with the auth0_drupal module.

@andrew-cormick-dockery
Copy link

Could you give some details on the test you performed? I don't think I've ever been able to reliably reproduce this issue.

@johntwyman
Copy link

Could you give some details on the test you performed? I don't think I've ever been able to reliably reproduce this issue.

I believe the test process is this:

  1. Give a user a domain-bound role in at least two domains
  2. Count the number of user-roles records in the database
  3. Login as the user in one of the domains for which there is a role
  4. Count the number of user-roles records in the database

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.

3 participants