Merge pull request #14720 from jmchilton/cleanup_job_files_1

Cleanup hack in job files API for very old versions of Galaxy.
This commit is contained in:
Marius van den Beek
2022-09-29 09:34:06 +02:00
committed by GitHub
+1 -8
View File
@@ -142,16 +142,9 @@ class JobFilesAPIController(BaseGalaxyAPIController):
https://gist.github.com/jmchilton/9103619.)
"""
in_work_dir = self.__in_working_directory(job, path, trans.app)
allow_temp_dir_file = self.__is_allowed_temp_dir_file(trans.app, job, path)
if not in_work_dir and not allow_temp_dir_file and not self.__is_output_dataset_path(job, path):
if not in_work_dir and not self.__is_output_dataset_path(job, path):
raise exceptions.ItemAccessibilityException("Job is not authorized to write to supplied path.")
def __is_allowed_temp_dir_file(self, app, job, path):
# grrr.. need to get away from new_file_path - these should be written
# to job working directory like metadata files.
in_temp_dir = util.in_directory(path, app.config.new_file_path)
return in_temp_dir and os.path.split(path)[-1].startswith("GALAXY_VERSION_")
def __is_output_dataset_path(self, job, path):
"""Check if is an output path for this job or a file in the an
output's extra files path.