Skip to content

Commit

Permalink
Avoid user role checks for individual datasets during workflow model …
Browse files Browse the repository at this point in the history
…build
  • Loading branch information
guerler committed Aug 10, 2016
1 parent e5e2996 commit 4a72f49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ def get_initial_value( self, trans, other_values ):
dataset_matcher = DatasetMatcher( trans, self, None, other_values )
if isinstance( self, DataToolParameter ):
for hda in reversed( history.active_datasets_children_and_roles ):
match = dataset_matcher.hda_match( hda )
match = dataset_matcher.hda_match( hda, check_security=trans.workflow_building_mode is workflow_building_modes.DISABLED )
if match:
return match.hda
else:
Expand Down Expand Up @@ -2038,7 +2038,7 @@ def append( list, id, hid, name, src, keep=False ):
visible_hda = other_values.get( self.name )
has_matched = False
for hda in history.active_datasets_children_and_roles:
match = dataset_matcher.hda_match( hda )
match = dataset_matcher.hda_match( hda, check_security=trans.workflow_building_mode is workflow_building_modes.DISABLED )
if match:
m = match.hda
has_matched = has_matched or visible_hda == m or visible_hda == hda
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/tools/parameters/dataset_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def valid_hda_match( self, hda, check_implicit_conversions=True, check_security=
return False
return rval

def hda_match( self, hda, check_implicit_conversions=True, ensure_visible=True ):
def hda_match( self, hda, check_implicit_conversions=True, check_security=True, ensure_visible=True ):
""" If HDA is accessible, return information about whether it could
match this parameter and if so how. See valid_hda_match for more
information.
"""
accessible = self.hda_accessible( hda )
accessible = self.hda_accessible( hda, check_security=check_security )
if accessible and ( not ensure_visible or hda.visible or ( self.selected( hda ) and not hda.implicitly_converted_parent_datasets ) ):
# If we are sending data to an external application, then we need to make sure there are no roles
# associated with the dataset that restrict its access from "public".
Expand Down

0 comments on commit 4a72f49

Please sign in to comment.