mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 01:27:03 +02:00
revert permissions tests in views and admin for is_staff
This commit is contained in:
parent
ef88f7b148
commit
128f619e14
3 changed files with 15 additions and 11 deletions
|
@ -837,11 +837,12 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
# Fixes a bug wherein users which are only is_staff
|
# Fixes a bug wherein users which are only is_staff
|
||||||
# can access 'change' when GET,
|
# can access 'change' when GET,
|
||||||
# but cannot access this page when it is a request of type POST.
|
# but cannot access this page when it is a request of type POST.
|
||||||
if request.user.has_perm(
|
# if request.user.has_perm(
|
||||||
"registrar.full_access_permission"
|
# "registrar.full_access_permission"
|
||||||
) or request.user.has_perm(
|
# ) or request.user.has_perm(
|
||||||
"registrar.analyst_access_permission"
|
# "registrar.analyst_access_permission"
|
||||||
) or request.user.is_staff:
|
# ):
|
||||||
|
if request.user.is_staff:
|
||||||
return True
|
return True
|
||||||
return super().has_change_permission(request, obj)
|
return super().has_change_permission(request, obj)
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,11 @@ class DomainPermission(PermissionsLoginMixin):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Check if the user is permissioned...
|
# Check if the user is permissioned...
|
||||||
user_is_analyst_or_superuser = self.request.user.has_perm(
|
# user_is_analyst_or_superuser = self.request.user.has_perm(
|
||||||
"registrar.analyst_access_permission"
|
# "registrar.analyst_access_permission"
|
||||||
) or self.request.user.has_perm("registrar.full_access_permission")
|
# ) or self.request.user.has_perm("registrar.full_access_permission")
|
||||||
|
|
||||||
|
user_is_analyst_or_superuser = self.request.user.is_staff
|
||||||
|
|
||||||
if not user_is_analyst_or_superuser:
|
if not user_is_analyst_or_superuser:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -33,9 +33,10 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
user = self.request.user
|
user = self.request.user
|
||||||
context["is_analyst_or_superuser"] = user.has_perm(
|
# context["is_analyst_or_superuser"] = user.has_perm(
|
||||||
"registrar.analyst_access_permission"
|
# "registrar.analyst_access_permission"
|
||||||
) or user.has_perm("registrar.full_access_permission")
|
# ) or user.has_perm("registrar.full_access_permission")
|
||||||
|
context["is_analyst_or_superuser"] = user.is_staff
|
||||||
# Stored in a variable for the linter
|
# Stored in a variable for the linter
|
||||||
action = "analyst_action"
|
action = "analyst_action"
|
||||||
action_location = "analyst_action_location"
|
action_location = "analyst_action_location"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue