mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-29 17:00:02 +02:00
Merge pull request #1974 from cisagov/es/1828-analyst-del-domain-mgr
1828: Allow analysts to delete domain managers of domains they do not manage
This commit is contained in:
commit
e4a8773e56
1 changed files with 6 additions and 1 deletions
|
@ -307,7 +307,12 @@ class UserDeleteDomainRolePermission(PermissionsLoginMixin):
|
||||||
domain=domain_pk,
|
domain=domain_pk,
|
||||||
domain__permissions__user=self.request.user,
|
domain__permissions__user=self.request.user,
|
||||||
).exists()
|
).exists()
|
||||||
if not has_delete_permission:
|
|
||||||
|
user_is_analyst_or_superuser = self.request.user.has_perm(
|
||||||
|
"registrar.analyst_access_permission"
|
||||||
|
) or self.request.user.has_perm("registrar.full_access_permission")
|
||||||
|
|
||||||
|
if not (has_delete_permission or user_is_analyst_or_superuser):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Check if more than one manager exists on the domain.
|
# Check if more than one manager exists on the domain.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue