-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 Approval Node Edit Permissions #8253
Fix Approval Node Edit Permissions #8253
Conversation
Build succeeded.
|
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.
Looks reasonable to me, but I helped write it, so I'd say let's see what @AlanCoding thinks.
awx/main/access.py
Outdated
@@ -2750,6 +2750,9 @@ def can_add(self, data): | |||
else: | |||
return (self.check_related('workflow_approval_template', UnifiedJobTemplate, role_field='admin_role')) | |||
|
|||
def can_change(self, obj, data): | |||
return self.user.can_access(WorkflowJobTemplate, 'change', obj.workflow_job_template, data=data) |
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.
Instead of passing data=data
, I would much prefer data={}
. The data you get contain fields for modification of the workflow approval template, not fields for the WFJT, which is how it would be interpreted in this call.
I'm also happy to take your word that the approval node's WFJT cannot be modified and cannot be null, so that this is not complicated further.
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.
Agreed, data={}
is probably what we want here.
d84be5c
to
f584c1c
Compare
Build succeeded.
|
Build succeeded (gate pipeline).
|
SUMMARY
Currently, users with the proper org/wfjt admin permissions are unable to edit approval nodes in workflow job templates that they should have edit permissions for. This PR should fix that bug.
ISSUE TYPE
COMPONENT NAME
AWX VERSION
ADDITIONAL INFORMATION