Skip to content

Commit

Permalink
adds function for hidding admin tools in toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
martindemko committed Apr 30, 2024
1 parent 31bfc27 commit 45eaa81
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions files/galaxy/lib/examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import logging
log = logging.getLogger( __name__ )

def restrict_testing_tools_to_admins( context, tool ):
"""
This tool filter will hide the upload tool from all users except admin
users. This can be enabled by renaming this file to examples.py and adding
the following to the ``app:main`` section of ``galaxy.ini``:
tool_filters = examples:restrict_testing_tools_to_admins
"""
if tool.id == "testing_html" or tool.id == "testing_pbs" or tool.id == "testing":
return context.trans.user_is_admin
return True
4 changes: 4 additions & 0 deletions group_vars/galaxyservers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ galaxy_config:
sanitize_allowlist_file: "{{ galaxy_mutable_config_dir }}/sanitize_allowlist.txt"
# This allows to do custom ordering of tools in sections, default was true, but Petr Novak wants specific orderring of tools
toolbox_auto_sort: false
# This hide specified tools for non-admin users
tool_filters: 'examples:restrict_testing_tools_to_admins'
smtp_server: "rs.cesnet.cz:25"
error_email_to: "[email protected]"
email_from: "[email protected]"
Expand Down Expand Up @@ -367,6 +369,8 @@ galaxy_config_files:
# dest: "{{ galaxy_config.galaxy.themes_config_file }}"
- src: files/galaxy/config/tpv_rules_local.yml
dest: "{{ tpv_mutable_dir }}/tpv_rules_local.yml"
- src: files/galaxy/lib/examples.py
dest: "{{ galaxy_server_dir }}/lib/galaxy/tool_util/toolbox/filters/examples.py"

galaxy_config_templates:
- src: templates/galaxy/config/auth_conf.xml.j2
Expand Down

0 comments on commit 45eaa81

Please sign in to comment.