Manage roles

Updated at:
Copy as MD

Agent Data Gateway manages data permissions through custom roles. Create a custom role, grant data permissions to the role, and add role members to control access to gateway resources at a fine granularity. This topic describes how to use role management.

Prerequisites

You have the permissions required for role management. If you do not have these permissions, contact an administrator to assign the administrator system role to you.

Note

The default administrator has the permissions required for role management.

Relationships between roles, users, and permission policies

A permission policy can be granted to a custom role or directly to a user. A custom role can be associated with users. After a user is associated with a role, the user obtains the permissions of the role policies. The restrictions of those policies also apply to the user.

To manage data permissions by using custom roles, perform the following operations:

  1. Create a custom role.

  2. Grant data permissions to the custom role. The role can then perform only the operations allowed by its permission policies, such as querying a specific table.

  3. Associate users with the custom role.

Access role management

  1. Log on to the AI-Native Database Service console.

  2. In the left-side navigation pane, click Agent Data Gateway to open the Agent Data Gateway console.

  3. In the left-side navigation pane of the console, choose User and Permission Management > Role Management.

The Role Management page contains the Custom Role and System Role tabs.

  • Custom Role: displays the custom roles that you created. This tab supports role creation and search by role name. The role list contains the Role ID, Role Name, Role Description, Type, Updated By, Updated At, and Actions columns.

  • System Role: displays the roles provided by the gateway by default. The data permissions of these roles cannot be modified.

The data permissions of a custom role can be modified. A user can hold multiple system roles and custom roles at the same time.

Platform roles (administrator and regular user) determine the operations that a user can perform on the platform. They belong to a different system from the system roles and custom roles in role management.

Create a custom role

  1. On the Custom Role tab, click Create Role.

  2. In the Create Role dialog box, configure the following parameters and click Confirm.

    Parameter

    Description

    Role Name

    Required. The name of the custom role.

    Role Description

    Optional. The description of the role, which explains the purpose of the role.

Grant data permissions to a custom role

  1. In the role list on the Custom Role tab, click Manage in the Actions column of the target role.

  2. On the Data Permissions tab, click Add Authorization.

  3. In the authorization panel, the grantee is the target role. Configure the following parameters and click Confirm.

    Parameter

    Description

    Authorization Scope

    The resource level at which the permissions apply. Valid values: Instance, Database, Table, Field, and Row.

    Target Resource

    The resource to authorize. Based on the selected authorization scope, select or search for a resource in the drop-down list.

    Permission Type

    The types of permissions to grant to the role. You can select multiple values. Valid values: Read (Query), Read (Knowledge Only), and Write (Modify).

    Validity Period

    The start time and end time of the permission. Select the start and end date and time manually, or use the 30 Days, 90 Days, 365 Days, or Permanent shortcut.

    Effective Window

    The time window in which the permission takes effect. By default, the permission takes effect every day. After you turn on this option, select the days of the week on which the permission takes effect.

    Effective Conditions

    Optional. Click Add Condition to add a condition. Multiple conditions are combined with AND. The permission takes effect only when all conditions are met.

Add role members

Members associated with a custom role obtain the data permissions granted by the role and are subject to the restrictions of its permission policies.

  1. In the role list on the Custom Role tab, click Manage in the Actions column of the target role.

  2. On the Role Members tab, click Add Members.

  3. In the Add Members dialog box, set Identity Type to User or Agent, select the target user or Agent, and click Confirm.

Note

Only users and independent Agents can be added. Role inheritance for permission-narrowed Agents is managed in My Agent Identity.

Alternatively, in the left-side navigation pane of the console, choose User and Permission Management > User Management. Edit the basic information of a user to associate roles with the user.

View the data permissions and members of a role

  1. In the role list on the Custom Role tab, click Manage in the Actions column of the target role.

  2. On the Data Permissions or Role Members tab, view the data permissions and members associated with the role.

    • Data Permissions tab: The table contains the Resource Type, Resource Name, Permission Type, Effective Conditions, and Actions columns. In the Actions column, you can edit or delete a permission policy. The top of the page provides filters by resource type and effective status, and supports resource search.

    • Role Members tab: The table contains the Member, Joined At, and Actions columns. You can search for members by name or ID.

Alternatively, in the left-side navigation pane of the console, choose User and Permission Management > User Management to view the roles that a user inherits.

Manage Agent roles

You can view the roles and data permissions of the Agents that you own. Role management differs by Agent type:

  • Permission-following Agent: automatically inherits the role permissions of its owner. Roles cannot be bound or unbound separately.

  • Permission-narrowed Agent: the owner can grant existing roles to the Agent or revoke role inheritance.

  • Independent Agent: does not inherit the roles of its owner. An administrator binds or unbinds roles.

View role permissions

  1. In the left-side navigation pane, choose User and Permission Management > My Agent Identity, and click Manage for the target agent.

  2. Choose the Data Permissions > Role Permissions tab to view the role list. The list contains the Role Name, Type, Inheritance Source, Grant to Agent, and Actions columns.

  3. In the Actions column of the target role, click View to view the data permissions of the role.

Manage role permissions

  • Permission-narrowed agent: On the My Agent Identity page, turn on the role authorization switch to allow the agent to inherit the permissions of the role. Turn off the switch to revoke the inheritance.

  • Permission-following agent: automatically follows the roles of its owner. After you bind or unbind roles for the owner, no separate configuration is required for the agent.

  • Independent agent: An administrator selects the target role on the Role Management page and binds it to the specified agent.

FAQ

What is the difference between a custom role and a system role?

System roles are provided by Agent Data Gateway by default, and their data permissions cannot be modified. The data permissions of custom roles can be modified. A user can hold multiple system roles and custom roles at the same time.

Can a user hold multiple roles at the same time?

Yes. A user can hold multiple system roles and custom roles at the same time and obtain the data permissions granted by all of these roles.