From 362a25e6e6b03dfada43ad1b9ab651966936c795 Mon Sep 17 00:00:00 2001 From: Eric Enns Date: Thu, 3 Dec 2015 10:48:39 -0600 Subject: [PATCH] Updated tool input collection to only add items from a collection which are being used by the tool and not the entire collection. (Thanks to @markiskander for helping me find this). --- lib/galaxy/tools/actions/__init__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py index 7bd281aa703..e743733a64d 100644 --- a/lib/galaxy/tools/actions/__init__.py +++ b/lib/galaxy/tools/actions/__init__.py @@ -111,9 +111,19 @@ class DefaultToolAction( object ): elif isinstance( input, DataCollectionToolParameter ): if not value: return - for i, v in enumerate( value.collection.dataset_instances ): + + dataset_instances = [] + if hasattr( value, 'child_collection' ): + # if we are mapping a collection over a tool, we only require the child_collection + dataset_instances = value.child_collection.dataset_instances + else: + # else the tool takes a collection as input so we need everything + dataset_instances = value.collection.dataset_instances + + for i, v in enumerate( dataset_instances ): data = v current_user_roles = trans.get_current_user_roles() + if not trans.app.security_agent.can_access_dataset( current_user_roles, data.dataset ): raise Exception( "User does not have permission to use a dataset (%s) provided for input." % data.id ) # Skipping implicit conversion stuff for now, revisit at