mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 22:19:28 -02:30
prevent input source changes without use role on source cred
To update an input source, the user must have admin access to the target credential and at least use role on the source credential.
This commit is contained in:
@@ -1202,7 +1202,10 @@ class CredentialInputSourceAccess(BaseAccess):
|
||||
if self.can_add(data) is False:
|
||||
return False
|
||||
|
||||
return self.user in obj.target_credential.admin_role
|
||||
return (
|
||||
self.user in obj.target_credential.admin_role and
|
||||
self.user in obj.source_credential.use_role
|
||||
)
|
||||
|
||||
@check_superuser
|
||||
def can_delete(self, obj):
|
||||
|
||||
Reference in New Issue
Block a user