Skip to content

Commit

Permalink
Merge pull request #652 from dannon/tool_path_expose
Browse files Browse the repository at this point in the history
Expose tool config file path to admins via the API.  This is useful (…
  • Loading branch information
bgruening committed Aug 26, 2015
2 parents b0f2eae + dc7f7f2 commit aea2503
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/galaxy/tools/__init__.py
Expand Up @@ -2303,6 +2303,10 @@ def to_dict( self, trans, link_details=False, io_details=False ):
# Basic information
tool_dict = super( Tool, self ).to_dict()

# If an admin user, expose the path to the actual tool config XML file.
if trans.user_is_admin():
tool_dict['config_file'] = os.path.abspath(self.config_file)

# Add link details.
if link_details:
# Add details for creating a hyperlink to the tool.
Expand Down
4 changes: 2 additions & 2 deletions test/unit/tools/test_toolbox_filters.py
Expand Up @@ -75,8 +75,8 @@ def allow_user_access(user, attempting_access):
return tool


def mock_trans( has_user=True ):
trans = Bunch( )
def mock_trans( has_user=True, is_admin=False ):
trans = Bunch( user_is_admin=lambda: is_admin )
if has_user:
trans.user = Bunch(preferences={})
else:
Expand Down

0 comments on commit aea2503

Please sign in to comment.