mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Allow remotely executed tools to write version files to the temp directory.
Like with discovered datasets - such use of this directory should be phased out in favor of the job's working directory of a job relative to it.
This commit is contained in:
@@ -118,9 +118,16 @@ class JobFilesAPIController( BaseAPIController ):
|
||||
https://gist.github.com/jmchilton/9103619.)
|
||||
"""
|
||||
in_work_dir = self.__in_working_directory( job, path, trans.app )
|
||||
if not in_work_dir and not self.__is_output_dataset_path( job, path ):
|
||||
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 ):
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user