mirror of
https://github.com/ansible/awx.git
synced 2026-07-09 15:28:05 -02:30
AC-696 Removed restriction on reassigning a credential to another user/team.
This commit is contained in:
@@ -524,14 +524,6 @@ class CredentialAccess(BaseAccess):
|
||||
return False
|
||||
|
||||
def can_change(self, obj, data):
|
||||
# Prevent moving a credential to a different user.
|
||||
user_pk = get_pk_from_dict(data, 'user')
|
||||
if obj and user_pk and obj.user and obj.user.pk != user_pk:
|
||||
raise PermissionDenied('Unable to change user on a credential')
|
||||
# Prevent moving a credential to a different team.
|
||||
team_pk = get_pk_from_dict(data, 'team')
|
||||
if obj and team_pk and obj.team and obj.team.pk != team_pk:
|
||||
raise PermissionDenied('Unable to change team on a credential')
|
||||
if self.user.is_superuser:
|
||||
return True
|
||||
if self.user == obj.created_by:
|
||||
|
||||
Reference in New Issue
Block a user