Fixed merge issues

This commit is contained in:
zandercymatics 2023-08-30 09:32:08 -06:00
parent 7e0a4aea76
commit 19d173efd4
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -41,11 +41,15 @@ class DomainPermission(PermissionsLoginMixin):
if pk is None:
raise ValueError("Primary key is None")
# user needs to have a role on the domain
# user needs to have a role on the domain,
# and user cannot be restricted
if UserDomainRole.objects.filter(
user=self.request.user, domain__id=pk
).exists():
).exists() and not self.request.user.is_restricted():
return True
elif self.request.user.is_restricted():
return False
# ticket 806
requested_domain = None
@ -87,10 +91,6 @@ class DomainPermission(PermissionsLoginMixin):
if can_do_action and user_is_analyst_or_superuser:
return True
# The user has an ineligible flag
if self.request.user.is_restricted():
return False
# if we need to check more about the nature of role, do it here.
return False