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

Fixes #23305: When custom role permission list is empty, reload lead to stack trace #4990

Conversation

fanf
Copy link
Member

@fanf fanf commented Aug 18, 2023

https://issues.rudder.io/issues/23305

We used to forbid creation of a rights without any Authorization - which is good ! But the correct way to forbid it is by making creation impossible, not throwing a runtime error.

This PR change the Rights class to a case class but with a private constructor to force the use of its object factory which does the correct checking and succeed in all case, returning the NoRights special value if needed.

Remaining part of the PR are change to accomodate the use of the factory in place of new.

All over, it's a nice simplification.

PR Normation/rudder-plugins#593 needs that one before being merged.

@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit ba3e72a into Normation:branches/rudder/7.3 Aug 21, 2023
15 checks passed
@fanf fanf deleted the bug_23305/when_custom_role_permission_list_is_empty_reload_lead_to_stack_trace branch March 15, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants