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
Fixes #22601: Missing validation button with admin #554
Conversation
@@ -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 |
There was a problem hiding this comment.
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) | ||
} | ||
|
There was a problem hiding this comment.
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.
We can't remove currentUserRights: Seq[String] parameters because they are defined in the trait within Rudder ? |
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 |
0fc0737
to
3103cf4
Compare
OK, merging this PR |
5cb1b1b
into
Normation:branches/rudder/7.3
https://issues.rudder.io/issues/22601