GRANT ROLE
Marked preset roles include the permission by default; a custom role qualifies when it inherits a role that includes it.
Use GRANT ROLE to assign a role to a user or to make one role inherit from another. For granting data access on a Share, see GRANT READ ON SHARE. See Roles and access control for the model.
Syntax​
GRANT ROLE <role_name> TO { USER <username> | ROLE <target_role> };
The grantee type must be explicit: use TO USER or TO ROLE.
Parameters​
| Parameter | Description | Required |
|---|---|---|
<role_name> | The role being granted or inherited. | Yes |
USER <username> | Assign the role to a user. | One of USER or ROLE |
ROLE <target_role> | Make <target_role> inherit <role_name>. | One of USER or ROLE |
Examples​
Assign a role to a user​
A user can hold several roles. Their permissions resolve as the union of all assigned roles.
GRANT ROLE finance TO USER alice;
Establish inheritance between roles​
Make a custom role inherit the platform privileges and grants of a parent role.
GRANT ROLE explorer TO ROLE finance;
Platform privileges evaluate across the full inheritance chain. If finance inherits explorer, a user with only finance gets Explorer platform capabilities.