Warning

This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.tool_util.toolbox.filters package

class galaxy.tool_util.toolbox.filters.ToolFilterContext(*args, **kwargs)[source]

Bases: Protocol

The attribute surface that toolbox filters are allowed to read.

galaxy.tools.Tool implements this protocol, and any lighter-weight stand-in a toolbox implementation hands to the filter layer must too. Admin / user-configured filter functions should only read fields documented here — it is the contract that lets the filter pass run against something cheaper than a fully-parsed Tool.

id: str
name: str
description: str
hidden: bool
require_login: bool
tool_type: str
labels: list[str]
tags: list[str]
allow_user_access(user, attempting_access: bool = True) bool[source]

Return True if user may see/run this tool.

Tool implements this directly (with subclass overrides for admin-only flavours like DataManagerTool); implementations should answer from their own state so the filter layer never needs to reach through context.trans.app.config.

__init__(*args, **kwargs)
class galaxy.tool_util.toolbox.filters.FilterFactory(toolbox)[source]

Bases: object

An instance of this class is responsible for filtering the list of tools presented to a given user in a given context.

__init__(toolbox)[source]
build_filters(trans, **kwds)[source]

Build list of filters to check tools against given current context.

build_filter_function(filter_name)[source]

Obtain python function (importing a submodule if needed) corresponding to filter_name.