Fix: align bulk edit perms with document model (#13757)

This commit is contained in:
shamoon
2026-08-22 05:24:16 -07:00
committed by GitHub
parent bbcd6af2fe
commit 7e4a644714
3 changed files with 195 additions and 23 deletions
+2 -1
View File
@@ -4879,10 +4879,11 @@ class BulkEditObjectsView(PassUserMixin):
if not user.is_superuser:
perm = f"documents.{perm_codename}"
# Limited to the owner (or unowned), same as documents, see BulkEditView
has_perms = (
user.has_perm(perm)
and not objs.exclude(
pk__in=permitted_object_ids(user, object_class, perm_codename),
Q(owner=user) | Q(owner__isnull=True),
).exists()
)