Skip to content

Commit 07bf803

Browse files
committed
fix: set files_locked to .locked rather than permission
* currently the permission is whether you can unlock the files * but the files are only unlocked when you create the draft * as such as an admin when you edit a published draft, if it was created by a user it will look like the files are unlocked but this is false this PR correctly sets files_locked to whether the files are locked
1 parent f5e5d16 commit 07bf803

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

invenio_app_rdm/records_ui/views/decorators.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,7 @@ def view(**kwargs):
8181
expand=expand,
8282
)
8383
kwargs["draft"] = draft
84-
kwargs["files_locked"] = (
85-
record_service.config.lock_edit_published_files(
86-
record_service, g.identity, draft=draft, record=draft._record
87-
)
88-
)
84+
kwargs["files_locked"] = draft._record.files.bucket.locked
8985
return f(**kwargs)
9086
except PIDDoesNotExistError:
9187
# Redirect to /records/:id because users are interchangeably

0 commit comments

Comments
 (0)