Skip to content

Commit 9594c5a

Browse files
committed
disable download of read files
1 parent e58f121 commit 9594c5a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

htsget_server/drs_operations.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ def download_file(object_id, request=connexion.request):
9090
return {"message": f"No object {object_id} was found"}, 404
9191
if "access_methods" not in drs_object:
9292
return {"message": f"No files are associated with object {object_id}"}, 404
93+
if "metadata" in drs_object:
94+
if "analysis_type" in drs_object["metadata"]:
95+
if drs_object["metadata"]["analysis_type"] == "reference_alignment":
96+
return {"message": f"Sorry, read files are not allowed to be downloaded"}, 403
9397
for method in drs_object["access_methods"]:
9498
if "access_url" in method:
9599
file_obj = _get_file_path(drs_object["id"])

0 commit comments

Comments
 (0)