From c4d225c6305589f7493ac00517c7fff91d508caf Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:43:35 +0200 Subject: [PATCH] Remove record access handling for Invenio 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. --- .../config/sample/user_preferences_extra_conf.yml.sample | 8 ++------ lib/galaxy/files/sources/invenio.py | 3 --- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/config/sample/user_preferences_extra_conf.yml.sample b/lib/galaxy/config/sample/user_preferences_extra_conf.yml.sample index 068c92918c3e..d34243cd0143 100644 --- a/lib/galaxy/config/sample/user_preferences_extra_conf.yml.sample +++ b/lib/galaxy/config/sample/user_preferences_extra_conf.yml.sample @@ -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: diff --git a/lib/galaxy/files/sources/invenio.py b/lib/galaxy/files/sources/invenio.py index aa502924478e..fe55563da4db 100644 --- a/lib/galaxy/files/sources/invenio.py +++ b/lib/galaxy/files/sources/invenio.py @@ -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,