After you create a role, you can assign the role to another role.
You can assign a role to any role other than itself. Circular role assignment is not supported.
Assign a role by using an SQL statement
To assign a role to another role, you must have the role to be assigned, and the ADMIN OPTION or GRANT ANY ROLE privilege.
For information about how to view your privileges, see View user privileges. If you do not have the required privilege, contact an administrator. For more information, see Modify user privileges. For more information about how to view your roles, see View roles.
Syntax for the SQL statement:
GRANT role_name1 TO role_name2 [WITH ADMID OPTION];
Notes:
role_name1: the name of the role to be assigned to another role. When you assign multiple roles to a role at a time, separate role names with commas (,).You can assign a role to multiple roles at a time, or assign multiple roles to one or more roles at a time.
WITH ADMIN OPTION: specifies that the assigned role can be assigned to other users, and role revocation does not extend to other users.
Example: assign the role2 role to the role1 role.
obclient> GRANT role2 TO role1;
Query OK, 0 rows affected
For more information about the GRANT statement, see GRANT.