Skip to content

Commit

Permalink
files link on record condition bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Krist committed Dec 5, 2024
1 parent 15673f4 commit 40cfebb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def process_links(self, datatype, section: Section, **kwargs):
link_class="ConditionalLink",
link_args=[
"cond=is_published_record()",
f'if_=RecordLink("{{+api}}{files_url_prefix}files", when=has_permission("list_files"))',
f'else_=RecordLink("{{+api}}{draft_files_url_prefix}files", when=has_permission("list_files"))',
f'if_=RecordLink("{{+api}}{files_url_prefix}files", when=has_permission_file_service("list_files"))',
f'else_=RecordLink("{{+api}}{draft_files_url_prefix}files", when=has_permission_file_service("list_files"))',
],
imports=[
Import("invenio_records_resources.services.ConditionalLink"),
Import("invenio_records_resources.services.RecordLink"),
Import("oarepo_runtime.services.config.is_published_record"),
Import("oarepo_runtime.services.config.has_permission"),
Import("oarepo_runtime.services.config.has_permission_file_service"),
],
)
),
Expand Down

0 comments on commit 40cfebb

Please sign in to comment.