airflow.providers.fab.www.security_manager

Attributes

EXISTING_ROLES

Classes

AirflowSecurityManagerV2

Custom security manager, which introduces a permission model adapted to Airflow.

Module Contents

airflow.providers.fab.www.security_manager.EXISTING_ROLES[source]
class airflow.providers.fab.www.security_manager.AirflowSecurityManagerV2(appbuilder)[source]

Bases: airflow.utils.log.logging_mixin.LoggingMixin

Custom security manager, which introduces a permission model adapted to Airflow.

appbuilder[source]
limiter[source]
static before_request()[source]

Run hook before request.

create_limiter()[source]
register_views()[source]

Allow auth managers to register their own views. By default, do nothing.

has_access(action_name, resource_name, user=None, resource_pk=None)[source]

Verify whether a given user could perform a certain action on the given resource.

Example actions might include can_read, can_write, can_delete, etc.

This function is called by FAB when accessing a view. See https://github.com/dpgaspar/Flask-AppBuilder/blob/c6fecdc551629e15467fde5d06b4437379d90592/flask_appbuilder/security/decorators.py#L134

Parameters:
  • action_name (str) – action_name on resource (e.g can_read, can_edit).

  • resource_name (str) – name of view-menu or resource.

  • user – user

  • resource_pk (str | None) – the resource primary key (e.g. the connection ID)

Returns:

Whether user could perform certain action on the resource.

Return type:

bool

create_admin_standalone()[source]

Perform the required steps when initializing airflow for standalone mode.

If necessary, returns the username and password to be printed in the console for users to log in.

add_limit_view(baseview)[source]
add_permissions_view(base_action_names, resource_name)[source]
add_permissions_menu(resource_name)[source]

Was this entry helpful?