-
Notifications
You must be signed in to change notification settings - Fork 2
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
Issue 48499: Use preferred SecurityPolicyManager.savePolicy() variant #375
Conversation
…alTask, pass in the User that started the pipeline job instead of User.getAdminServiceUser(). This user will have admin permissions in all the Panorama Public project folders.
@@ -544,7 +544,7 @@ private void updatePermissions(User formSubmitter, ExperimentAnnotations targetE | |||
assignPanoramaPublicSubmitterRole(newPolicy, log, targetExperiment.getSubmitterUser(), targetExperiment.getLabHeadUser(), | |||
formSubmitter); // User that submitted the form. Can be different from the user selected as the data submitter | |||
|
|||
SecurityPolicyManager.savePolicy(newPolicy); | |||
SecurityPolicyManager.savePolicy(newPolicy, pipelineJobUser); |
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.
It should be OK to pass in the User that started the pipeline job instead of User.getAdminServiceUser(). I will revert the changes in my commit if tests fail due to this change.
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.
Thanks!
{ | ||
MutableSecurityPolicy newPolicy = new MutableSecurityPolicy(target, target.getPolicy()); | ||
newPolicy.addRoleAssignment(reader, ReaderRole.class); | ||
SecurityPolicyManager.savePolicy(newPolicy); | ||
SecurityPolicyManager.savePolicy(newPolicy, pipelineJobUser); |
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.
Same here. It should be OK to pass in the User that started the pipeline job instead of User.getAdminServiceUser().
Rationale
We're uneven in terms of the validation and auditing we do for saving SecurityPolicies and related updates, and want to be more consistent.
Related Pull Requests
Changes
savePolicy
andcreateContainer
methods that don't take a user, check permissions, or log for audit purposesUser.getAdminServiceUser()
forsudo
like scenarios or when we're doing an operation not initiated by a user, like bootstrapping the server