add-role

Definition

Adds a role to a user.

Usage

$ airflow users add-role [-h]
                        [-e EMAIL]
                        -r ROLE
                        [-u USERNAME]
                        [-v]

Arguments

Parameter Description

-e, --email

Email of the user. Specify either --username or --email, but not both

-r, --role

Role to add for the user. Examples: Admin, User, Op, Viewer, Public

-u, --username

Name of the user. Specify either --username or --email, but not both

-h, --help

Print out the help manual for this command

-v, --verbose

Make logging output more verbose

Examples

To add the administrator role to a user, run:

$ airflow users add-role -e user2@user.com -r Admin

Output example:

[2025-04-03T12:42:04.284+0000] {manager.py:226} INFO - Updated user john doe
User "user2" added to role "Admin"
Found a mistake? Seleсt text and press Ctrl+Enter to report it