mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-15 05:54:11 +02:00
changed the order of the permissions checking as the manage domain check was firing before editable check and allowing access
This commit is contained in:
parent
315638c020
commit
abe35b9d63
1 changed files with 4 additions and 4 deletions
|
@ -46,6 +46,10 @@ class DomainPermission(PermissionsLoginMixin):
|
||||||
if pk is None:
|
if pk is None:
|
||||||
raise ValueError("Primary key is None")
|
raise ValueError("Primary key is None")
|
||||||
|
|
||||||
|
# test if domain in editable state
|
||||||
|
if not self.in_editable_state(pk):
|
||||||
|
return False
|
||||||
|
|
||||||
if self.can_access_other_user_domains(pk):
|
if self.can_access_other_user_domains(pk):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -53,10 +57,6 @@ class DomainPermission(PermissionsLoginMixin):
|
||||||
if not UserDomainRole.objects.filter(user=self.request.user, domain__id=pk).exists():
|
if not UserDomainRole.objects.filter(user=self.request.user, domain__id=pk).exists():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# test if domain in editable state
|
|
||||||
if not self.in_editable_state(pk):
|
|
||||||
return False
|
|
||||||
|
|
||||||
# if we need to check more about the nature of role, do it here.
|
# if we need to check more about the nature of role, do it here.
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue