Skip to content

Commit

Permalink
Remove record access handling for Invenio
Browse files Browse the repository at this point in the history
It is better to always work with `draft` versions of records and leave the publication handling directly to the Invenio platform.

In addition, some Invenio RDM compatible repositories like Zenodo don't allow access handling through the API using your personal token.
  • Loading branch information
davelopez committed Oct 25, 2023
1 parent d8b9929 commit c4d225c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,14 @@ preferences:
description: Your Invenio RDM Integration Settings
inputs:
- name: token
label: Personal Token to upload files to Invenio RDM
label: Personal Token used to create draft records and to upload files
type: secret
store: vault # Requires setting up vault_config_file in your galaxy.yml
required: False
- name: public_name
label: Creator name to associate with new records (formatted as "Last name, First name"). If left blank "Anonymous Galaxy User" will be used.
label: Creator name to associate with new records (formatted as "Last name, First name"). If left blank "Anonymous Galaxy User" will be used. You can always change this by editing your record directly.
type: text
required: False
- name: public_records
label: Whether to make draft records publicly available or restricted.
type: boolean
required: False

# Used in file_sources_conf.yml
onedata:
Expand Down
3 changes: 0 additions & 3 deletions lib/galaxy/files/sources/invenio.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,7 @@ def get_files_in_record(
def create_draft_record(self, title: str, user_context: OptionalUserContext = None) -> RemoteDirectory:
today = datetime.date.today().isoformat()
creator = self._get_creator_from_user_context(user_context)
public = bool(self.get_user_preference_by_key("public_records", user_context))
access = "public" if public else "restricted"
create_record_request = {
"access": {"record": access, "files": access},
"files": {"enabled": True},
"metadata": {
"title": title,
Expand Down

0 comments on commit c4d225c

Please sign in to comment.