mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Use unrestricted() when compiling ObjectPermissions for user
This commit is contained in:
@ -24,7 +24,7 @@ class ObjectPermissionBackend(ModelBackend):
|
|||||||
Return all permissions granted to the user by an ObjectPermission.
|
Return all permissions granted to the user by an ObjectPermission.
|
||||||
"""
|
"""
|
||||||
# Retrieve all assigned ObjectPermissions
|
# Retrieve all assigned ObjectPermissions
|
||||||
object_permissions = ObjectPermission.objects.filter(
|
object_permissions = ObjectPermission.objects.unrestricted().filter(
|
||||||
Q(users=user_obj) |
|
Q(users=user_obj) |
|
||||||
Q(groups__user=user_obj)
|
Q(groups__user=user_obj)
|
||||||
).prefetch_related('object_types')
|
).prefetch_related('object_types')
|
||||||
|
Reference in New Issue
Block a user