Roles
Role management may be performed via the SQL editor. To grant or revoke privileges to a role, use the GRANT command.
Creating a New Role
CREATE ROLE "<role_name>"
Parameters
<role_name>
String
Indicates the name you wish to give the new role.
Example
CREATE ROLE "role1"
Granting a Role to a User
GRANT ROLE "<role_name>"
TO USER "<username>"
Parameters
<role_name>
String
Indicates the name of the role you are assigning to a user.
<username>
String
Indicates the username associated with the user account you are granting to the role.
Example
GRANT ROLE "role1"
TO USER "user@dremio.com"
Revoking a Role from a User
REVOKE ROLE "<role_name>"
FROM USER "<username>"
Parameters
<role_name>
String
Indicates the name of the role you wish to revoke.
<username>
String
Indicates the username associated with the user account you are revoking the role from.
Example
REVOKE ROLE "role1"
FROM USER "user@dremio.com"
Nesting a Role within a Role
GRANT ROLE "<sub_role>"
TO ROLE "<parent_role>"
Parameters
<sub_role>
String
Indicates the name of the role that you want to be nested.
<parent_role>
String
Indicates the name of the role that will be used as the parent to the nested role.
Example
GRANT ROLE "subrole"
TO ROLE "role1"
Removing a Nested Role
REVOKE ROLE "<sub_role>"
FROM ROLE "<parent_role>"
Parameters
<sub_role>
String
Indicates the name of the role that you wish to remove from the parent role.
<parent_role>
String
Indicates the name of the parent that the nested role is currently assigned to.
Example
REVOKE ROLE "subrole"
FROM ROLE "role1"
Deleting a Role
DROP ROLE "<role_name>"
Parameters
<role_name>
String
Indicates the role you are deleted.
Example
DROP ROLE "role1"