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 #22601: Missing validation button with admin #554

Conversation

fanf
Copy link
Member

@fanf fanf commented Apr 5, 2023

@fanf fanf requested a review from VinceMacBuche April 5, 2023 14:13
@@ -167,12 +170,20 @@ class ChangeRequestDetails extends DispatchSnippet with Loggable {
}

def displayActionButton(cr: ChangeRequest, step: WorkflowNodeId): NodeSeq = {
val authz = CurrentUser.getRights.authorizationTypes.toSeq.collect { case right: ActionType.Edit => right.authzKind }
val authz = Nil // we are sideStepping it, see: https://issues.rudder.io/issues/22595
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the problem: we don't look for any because we are comaring on strings, not with the correct Authorization method.
We can change that now, see: https://issues.rudder.io/issues/22595

val correctActor = selfValidation().getOrElse(false) || !isCreator
correctActor && CurrentUser.checkRights(AuthorizationType.Validator.Edit)
}

Copy link
Member Author

Choose a reason for hiding this comment

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

These two methods are the relevant changes: we use CurrentUser.checkRights in place of a comparison on string. That methods correctly check for the any right that admin has.

@VinceMacBuche
Copy link
Member

We can't remove currentUserRights: Seq[String] parameters because they are defined in the trait within Rudder ?

@fanf
Copy link
Member Author

fanf commented Apr 20, 2023

yes, the API is there, and we are trying to make 7.3 stable, and I'm not sure about what we want for an API

@fanf fanf changed the base branch from 7.3-next to branches/rudder/7.3 April 20, 2023 14:18
@fanf fanf force-pushed the bug_22601/missing_validation_button_with_admin branch from 0fc0737 to 3103cf4 Compare April 20, 2023 14:39
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 5cb1b1b into Normation:branches/rudder/7.3 Apr 25, 2023
8 checks passed
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