Skip to content

Commit

Permalink
Merge pull request #652 from sennetconsortium/maxsibilla/fix-metadata…
Browse files Browse the repository at this point in the history
…-write

Move block of code that sets published directory permissions after wr…
  • Loading branch information
maxsibilla authored Feb 13, 2025
2 parents 64b90d1 + d33fc34 commit 6cc318f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/routes/entity_CRUD/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,6 @@ def publish_datastage(identifier):
if asset_dir_exists:
ingest_helper.relink_to_public(dataset_uuid)

acls_cmd = ingest_helper.set_dataset_permissions(dataset_uuid, dataset_group_uuid, data_access_level,
True, no_indexing_and_acls)

doi_info = None
# Generating DOI's for lab processed/derived data as well as IEC/pipeline/airflow processed/derived data).
if is_primary or has_entity_lab_processed_dataset_type:
Expand Down Expand Up @@ -972,6 +969,10 @@ def publish_datastage(identifier):
logger.exception(f"Fatal error while writing md_file {md_file}; {str(e)}")
return jsonify({"error": f"{dataset_uuid} problem writing metadata.json file."}), 500

# Change the directory permissions to prevent user from writing to published folder
acls_cmd = ingest_helper.set_dataset_permissions(dataset_uuid, dataset_group_uuid, data_access_level,
True, no_indexing_and_acls)

if no_indexing_and_acls:
r_val = {'acl_cmd': acls_cmd, 'sources_for_indexing': sources_to_reindex}
else:
Expand Down

0 comments on commit 6cc318f

Please sign in to comment.