mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-02 16:02:15 +02:00
Add analyst or superuser check for deleting user role
This commit is contained in:
parent
4989e47b3a
commit
e59c3613ac
1 changed files with 6 additions and 1 deletions
|
@ -307,7 +307,12 @@ class UserDeleteDomainRolePermission(PermissionsLoginMixin):
|
|||
domain=domain_pk,
|
||||
domain__permissions__user=self.request.user,
|
||||
).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
|
||||
|
||||
# Check if more than one manager exists on the domain.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue