mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add name, enabled fields to ObjectPermission
This commit is contained in:
@ -23,10 +23,10 @@ class ObjectPermissionBackend(ModelBackend):
|
||||
"""
|
||||
Return all permissions granted to the user by an ObjectPermission.
|
||||
"""
|
||||
# Retrieve all assigned ObjectPermissions
|
||||
# Retrieve all assigned and enabled ObjectPermissions
|
||||
object_permissions = ObjectPermission.objects.unrestricted().filter(
|
||||
Q(users=user_obj) |
|
||||
Q(groups__user=user_obj)
|
||||
Q(users=user_obj) | Q(groups__user=user_obj),
|
||||
enabled=True
|
||||
).prefetch_related('object_types')
|
||||
|
||||
# Create a dictionary mapping permissions to their constraints
|
||||
|
Reference in New Issue
Block a user