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.
The syntax for assigning a role to another role is as follows:
GRANT role_name1 TO role_name2 [WITH ADMID OPTION];
Some notes about this:
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 roles, and role revocation does not extend to other roles.
For 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.
Assign a role in the OCP console
You can assign a role to another role in the OceanBase Cloud Platform (OCP) console.
Prerequisites
The TENANT_MANAGER role is assigned to you. Otherwise, request the OCP administrator to assign the role. For more information, see "Edit a user" in the OCP User Guide of the corresponding version.
Procedure
Log on to the OCP console.
In the left-side navigation pane, click Tenants to go to the Tenants page.
In the Tenants section, click the name of an Oracle tenant to go to the details page of the tenant.
In the left-side navigation pane, click User Management. On the page that appears, click the Roles tab.
On the Roles tab, click the name of the role that you want to modify to go to the details page of the role.
In the Roles section, click Modify Role.
In the Modify Role dialog box, select a role.
Click OK.