From a737ddd9e5b73a1a602c48ed6f1546581479faca Mon Sep 17 00:00:00 2001 From: Kyle Ellrott Date: Thu, 14 Aug 2014 13:19:43 -0700 Subject: [PATCH 1/2] Adding method for workflows to use input with 'src' set as 'uuid', it will then scan datasets for a matching uuid. --- lib/galaxy/workflow/run_request.py | 9 +++++++++ templates/show_params.mako | 14 ++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/workflow/run_request.py b/lib/galaxy/workflow/run_request.py index 804df21f0e8..67001ad83cc 100644 --- a/lib/galaxy/workflow/run_request.py +++ b/lib/galaxy/workflow/run_request.py @@ -188,6 +188,15 @@ def build_workflow_run_config( trans, workflow, payload ): content = trans.sa_session.query(app.model.HistoryDatasetAssociation).get( trans.security.decode_id(input_id)) assert trans.user_is_admin() or trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), content.dataset ) + elif input_source == 'uuid': + dataset = trans.sa_session.query(app.model.Dataset).filter(app.model.Dataset.uuid==input_id).first() + if dataset is None: + #this will need to be changed later. If federation code is avalible, then a missing UUID + #could be found amoung fereration partners + message = "Input cannot find UUID: %s." % input_id + raise exceptions.RequestParameterInvalidException( message ) + content = history.add_dataset(dataset) + assert trans.user_is_admin() or trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), content.dataset ) elif input_source == 'hdca': content = app.dataset_collections_service.get_dataset_collection_instance( trans, diff --git a/templates/show_params.mako b/templates/show_params.mako index b4952f64360..acdaedad9c0 100644 --- a/templates/show_params.mako +++ b/templates/show_params.mako @@ -23,7 +23,7 @@ ${ inputs_recursive(input.inputs, param_values[input.name][i], depth=depth+1) } %endfor %elif input.type == "conditional": - <% + <% try: current_case = param_values[input.name]['__current_case__'] is_valid = True @@ -53,7 +53,7 @@ %elif input.visible: - <% + <% if hasattr( input, "label" ) and input.label: label = input.label else: @@ -70,7 +70,7 @@ ## Parameter does not have a stored value. <% - # Get parameter label. + # Get parameter label. if input.type == "conditional": label = input.test_param.label elif input.type == "repeat": @@ -83,7 +83,7 @@ %endif - + %endfor @@ -91,7 +91,7 @@ <%def name="inputs_recursive_indent( text, depth )"> ${text | h} - + @@ -120,6 +120,9 @@ + %if hda.dataset.uuid: + + %endif %if trans.user_is_admin() or trans.app.config.expose_dataset_path: %endif @@ -168,4 +171,3 @@ '${dep[0].name | h}' in ${dep[1]}
% endfor - From d1986d4db238e1750888e01c4e7bbe8d45266461 Mon Sep 17 00:00:00 2001 From: Kyle Ellrott Date: Thu, 14 Aug 2014 13:38:55 -0700 Subject: [PATCH 2/2] Checking security before creating the HDA --- lib/galaxy/workflow/run_request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/workflow/run_request.py b/lib/galaxy/workflow/run_request.py index 67001ad83cc..3a9a475eba2 100644 --- a/lib/galaxy/workflow/run_request.py +++ b/lib/galaxy/workflow/run_request.py @@ -195,8 +195,8 @@ def build_workflow_run_config( trans, workflow, payload ): #could be found amoung fereration partners message = "Input cannot find UUID: %s." % input_id raise exceptions.RequestParameterInvalidException( message ) + assert trans.user_is_admin() or trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), dataset ) content = history.add_dataset(dataset) - assert trans.user_is_admin() or trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), content.dataset ) elif input_source == 'hdca': content = app.dataset_collections_service.get_dataset_collection_instance( trans,
Tool Standard Error:stderr
Tool Exit Code:${job.exit_code | h}
API ID:${encoded_hda_id}
UUID:${hda.dataset.uuid}
Full Path:${hda.file_name | h}