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

Sync the is_superuser flag when the members relationship changes #8833

Merged
merged 4 commits into from
Dec 11, 2020

Conversation

AlanCoding
Copy link
Member

This was giving the wrong behavior before.

work started by @rebeccahhh at

devel...rebeccahhh:devel

rebeccahhh and others added 3 commits December 10, 2020 12:26
…ior it was only corroborating from the DB to RBAC and we need both ways
… impact the data sent within the POST so that it can impact the User model, this may not work because the POST is related only to the Roles model
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

'When the is_superuser flag is false but a user has the System Admin role, update the database to reflect that'
if kwargs['action'] in ['post_add', 'post_remove', 'post_clear']:
new_status_value = bool(kwargs['action'] == 'post_add')
if hasattr(instance, 'singleton_name'): # duck typing, role.members.add() vs user.roles.add()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone hates me too bad for this, you could use the reverse kwarg, but how do you know at a glance which is the reverse and which is the non-reverse?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say something about the use of singleton_name here, but apparently that's an actual field on the Role model.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

Copy link
Member

@rebeccahhh rebeccahhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have passing testing

Copy link
Contributor

@jbradberry jbradberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit e5436a0 into ansible:devel Dec 11, 2020
@AlanCoding AlanCoding deleted the is_superuser branch June 23, 2021 18:15
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