Support update vs create

This commit is contained in:
shamoon
2025-07-02 12:33:36 -07:00
parent 67624e539b
commit f9a5cfa1bf
7 changed files with 96 additions and 22 deletions

View File

@@ -1375,17 +1375,21 @@ class BulkEditView(PassUserMixin):
method in [bulk_edit.merge, bulk_edit.split]
and parameters["delete_originals"]
)
or (method == bulk_edit.edit_pdf and parameters["delete_original"])
or (method == bulk_edit.edit_pdf and parameters["update_document"])
):
has_perms = user_is_owner_of_all_documents
# check global add permissions for methods that create documents
if (
has_perms
and method in [bulk_edit.split, bulk_edit.merge, bulk_edit.edit_pdf]
and not user.has_perm(
"documents.add_document",
and (
method in [bulk_edit.split, bulk_edit.merge]
or (
method == bulk_edit.edit_pdf
and not parameters["update_document"]
)
)
and not user.has_perm("documents.add_document")
):
has_perms = False
@@ -1398,7 +1402,6 @@ class BulkEditView(PassUserMixin):
method in [bulk_edit.merge, bulk_edit.split]
and parameters["delete_originals"]
)
or (method == bulk_edit.edit_pdf and parameters["delete_original"])
)
and not user.has_perm("documents.delete_document")
):