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

fix: deletion validation didnt account for groups #4441

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

daveleek
Copy link
Contributor

@daveleek daveleek commented Aug 8, 2023

About the changes

Fixes an issue where project role deletion validation didn't validate against project roles being connected to groups

@sonatype-lift
Copy link

sonatype-lift bot commented Aug 8, 2023

Sonatype Lift is retiring

Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

@vercel
Copy link

vercel bot commented Aug 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2023 10:25am
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2023 10:25am

throw new RoleInUseError(
'Role is in use by more than one user. You cannot delete a role that is in use without first removing the role from the users.',
'Role is in use by one or more users or groups. You cannot delete a role that is in use without first removing the role from the users and groups.',
Copy link
Contributor

Choose a reason for hiding this comment

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

two ifs here and different error messages would probably make this easier to debug for the user

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just a simple users(0) or groups(23)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @gardleopard! good feedback! I like the simple solution as it gives you overview of both regardless of which was the trigger. This is also part of an improvement of the UI that gives you an overview of usage before you attempt deleting

Copy link
Contributor

@gardleopard gardleopard left a comment

Choose a reason for hiding this comment

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

Great, added a comment about the message that can potentially share more information, but approving anyway:)

@daveleek daveleek merged commit 57c448c into main Aug 8, 2023
16 checks passed
@daveleek daveleek deleted the fix/project-role-deletion-validation branch August 8, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants