mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
ObjectPermissionRequiredMixin should exempt superusers
This commit is contained in:
@ -19,7 +19,7 @@ class ObjectPermissionRequiredMixin(AccessMixin):
|
||||
|
||||
# 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.
|
||||
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
|
||||
|
||||
# If the permission is granted only at the object level, filter the view's queryset to return only objects
|
||||
|
Reference in New Issue
Block a user