airflow.providers.fab.www.security_manager

Attributes

EXISTING_ROLES

Classes

AirflowSecurityManagerV2

Minimal security manager needed to run a Flask application.

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

Minimal security manager needed to run a Flask application.

This one is used to run the Flask application needed to run Airflow 2 plugins unless Fab auth manager is configured in the environment. In that case, FabAirflowSecurityManagerOverride is used.

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

Run hook before request.

create_limiter()[source]
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

add_limit_view(baseview)[source]

Was this entry helpful?