mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Fix inherited permissions should not display per user in permissions form
This commit is contained in:
@@ -63,6 +63,7 @@ def set_permissions_for_object(permissions, object):
|
||||
users_to_remove = get_users_with_perms(
|
||||
object,
|
||||
only_with_perms_in=[permission],
|
||||
with_group_users=False,
|
||||
)
|
||||
if len(users_to_add) > 0 and len(users_to_remove) > 0:
|
||||
users_to_remove = users_to_remove.difference(users_to_add)
|
||||
|
@@ -161,6 +161,7 @@ class OwnedObjectSerializer(serializers.ModelSerializer, SetPermissionsMixin):
|
||||
"users": get_users_with_perms(
|
||||
obj,
|
||||
only_with_perms_in=[view_codename],
|
||||
with_group_users=False,
|
||||
).values_list("id", flat=True),
|
||||
"groups": get_groups_with_only_permission(
|
||||
obj,
|
||||
@@ -171,6 +172,7 @@ class OwnedObjectSerializer(serializers.ModelSerializer, SetPermissionsMixin):
|
||||
"users": get_users_with_perms(
|
||||
obj,
|
||||
only_with_perms_in=[change_codename],
|
||||
with_group_users=False,
|
||||
).values_list("id", flat=True),
|
||||
"groups": get_groups_with_only_permission(
|
||||
obj,
|
||||
|
@@ -964,6 +964,7 @@ class UiSettingsView(GenericAPIView):
|
||||
"id": user.id,
|
||||
"username": user.username,
|
||||
"is_superuser": user.is_superuser,
|
||||
"groups": user.groups.values_list("id", flat=True),
|
||||
},
|
||||
"settings": ui_settings,
|
||||
"permissions": roles,
|
||||
|
Reference in New Issue
Block a user