mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
ObjectPermissionRequiredMixin should exempt superusers
This commit is contained in:
parent
94d0ebbd7d
commit
be5962fb3a
@ -19,7 +19,7 @@ class ObjectPermissionRequiredMixin(AccessMixin):
|
|||||||
|
|
||||||
# Next, determine whether the permission is model-level or object-level. Model-level permissions grant the
|
# Next, determine whether the permission is model-level or object-level. Model-level permissions grant the
|
||||||
# specified action to *all* objects, so no further action is needed.
|
# specified action to *all* objects, so no further action is needed.
|
||||||
if self.permission_required in self.request.user._perm_cache:
|
if self.request.user.is_superuser or self.permission_required in self.request.user._perm_cache:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# If the permission is granted only at the object level, filter the view's queryset to return only objects
|
# If the permission is granted only at the object level, filter the view's queryset to return only objects
|
||||||
|
Loading…
Reference in New Issue
Block a user