Use IAM to control access permissions

Updated at:

The MaxCompute IAM permission system addresses security control of data assets across projects, namespaces, and accounts. Mechanisms provided by CatalogAPI, such as roles (Role), policies (Policy), policy tags (PolicyTag), and data policies (DataPolicy), enable fine-grained access control that meets enterprise-level data security and compliance requirements.

Features

The MaxCompute IAM permission system is a multi-level access control system built on CatalogAPI. It provides permission management at the account (Namespace) level and the project (Project) level, and supports fine-grained permission control over data assets through custom roles, policy bindings, column-level access control, and dynamic data masking.

Permission model

The MaxCompute IAM permission system uses a policy-based (Policy) access control model. A Policy consists of a set of bindings (Binding). Each Binding binds a role (Role) to a set of members (Members). The Policy model is structured as follows:

{
  "etag": "string",
  "bindings": [
    {
      "role": "string",
      "members": ["string"]
    }
  ]
}

The fields are described as follows:

Field

Description

etag

Used for consistency checks in read-modify-write operations.

bindings

The list of role bindings.

role

The role name. The full path is namespaces/{namespaceId}/roles/{roleName}.

members

The list of members, in the format of user:{userId}.

Resource hierarchy

The following figure shows the IAM resource hierarchy. A Namespace contains Connection, Role, Taxonomy, DataPolicy, DataScan, and Project. A Project contains objects such as Schema and Table.

image

Permissions are divided into two levels based on the resource hierarchy:

Resource level

Resources included

Description

Account (Namespace) level

Role, Taxonomy, PolicyTag, DataPolicy, Connection

  • Managed by the Alibaba Cloud account. Permissions can be granted to tenant-level administrators.

  • The Namespace ID is the UID of the Alibaba Cloud account. When calling Namespace-level APIs such as Connection and Role APIs, pass the UID of the Alibaba Cloud account as the Namespace parameter.

Project (Project) level

Schema, Table, Function, Resource, Model

Managed by project administrators. Schema-level and Table-level policies are supported.

Characteristics

  • A new hierarchical structure that provides a complete, layered management and control system

    • Resource Directory (Resource Directory, RD) addresses security boundaries across accounts.

    • A namespace (Namespace, equivalent to a tenant) provides a higher-level point for unified management and policy definition.

    • A project is the core resource and security boundary.

    • A Schema adds logical grouping and authorization at an intermediate level.

    • A table is the final data carrier and supports the finest-grained permission control and column-level security (implemented through policy tags).

  • Automatic permission inheritance across hierarchical resources

    • Simplified management

      Permissions granted at a higher level are automatically applied to all lower-level objects through inheritance, which greatly reduces repeated authorization operations.

    • Precise control

      When finer-grained permissions are required, permissions can be granted directly at a specific level, such as Table. These permissions are not automatically inherited by other objects, which meets specific cross-department data dependency requirements.

  • Dynamic data masking based on policy tags (Policy Tag)

    • Enhanced data security and compliance

      Sensitive data tags are defined centrally and associated with masking policies, which effectively prevents the leakage of sensitive information and meets enterprise compliance requirements.

    • Flexible and fine-grained access control

      Policy tags support hierarchical structures and inheritance. Access rules (raw data or masked data) can be defined uniformly at the tag level and applied to specific columns to achieve fine-grained column-level control.

    • Improved data collaboration efficiency

      Different roles see data views at different levels based on their permissions, which promotes data sharing while ensuring security.

    • Reduced management complexity

      Policy tags and data policies are managed centrally at the namespace level and reused across projects. This simplifies sensitive data governance in large-scale environments and ensures policy consistency.

  • Enhanced cross-domain access control and security compliance

    Identity boundary control based on Resource Directory (RD) and a fine-grained hierarchical permission system effectively prevent unauthorized cross-account access, meet the strict compliance and data security requirements of enterprises in multi-account environments, and simplify security management processes.

Scenarios

Operation permissions on existing MaxCompute data objects are mainly based on the project level, which does not adequately support the permission requirements of complex organizational structures, such as Resource Directory (RD) users. IAM permissions introduce entity concepts such as Namespace as a data plane boundary larger than a project, and support a new permission model for data objects. IAM permissions apply to the following scenarios:

  • Cross-account authorization (Cross-Account)

    Authorization across Alibaba Cloud accounts within the same resource directory (Resource Directory), which enables secure data flow between different departments of the same enterprise entity.

  • Cross-project authorization (Cross-Project)

    Control of data plane resources across projects within a namespace.

  • Authorization inheritance across the resource hierarchy (Resource Hierarchy)

    In the three-layer model (Namespace → Project → Schema), resources automatically inherit the policies of all levels above them, which allows administrators to grant permissions on resources as a whole package, such as an entire Project or Schema.

  • Centralized security policies

    A single set of centralized security policies controls data plane resources across projects. This avoids repeated policy configuration at the project level and reduces the security risks caused by inconsistent policies across projects.

  • Policy tags (Policy Tag)

    Following the same hierarchical inheritance rules, policy tags are bound to specified table columns through Taxonomy and PolicyTag, and DataPolicy masking rules are defined for PolicyTag. This achieves fine-grained access control over sensitive columns in data tables.

Limits

  • MaxCompute is activated, and at least one MaxCompute project that uses the three-level model (project.schema.table) is created. The CreateTable, CreateModel, CreateFunction, and CreateResource permissions do not currently support two-level projects (project.table).

  • A RAM user or RAM role is created.

  • For a Project and the objects in it, IAM currently supports control over table (including view) data only, and does not support control over jobs (Job). Therefore, other object permissions such as CreateInstance must still be controlled through the existing permission system. For more information, see MaxCompute permissions. IAM permission control capabilities will continue to be improved in future iterations.

  • IAM permissions must be enabled for the project. For more information, see Enable IAM permissions.

  • To initialize administrators, the operator must have the required RAM permissions. For more information, see Initialize administrators.

  • Supported regions: China (Chengdu), China (Shenzhen), China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Hong Kong), China East 1 Finance, Indonesia (Jakarta), Singapore, Germany (Frankfurt), US (Silicon Valley), US (Virginia), UAE (Dubai), and Mexico.

Procedure overview

The following figure shows the overall procedure for IAM permissions. Create roles in a Namespace, and then bind users and roles to data resources or DataPolicy.

image

IAM permissions

IAM permissions are categorized by resource type as follows:

Resource type

Permission

Namespace

Namespace permissions

  • GetNamespacePolicy

  • SetNamespacePolicy

  • SearchNamespace

Role

Role permissions

  • CreateRole

  • ListRole

  • DeleteRole

  • GetRole

  • UpdateRole

  • GetRolePolicy

  • SetRolePolicy

Taxonomy

Taxonomy permissions

  • CreateTaxonomy

  • ListTaxonomy

  • DeleteTaxonomy

  • GetTaxonomy

  • UpdateTaxonomy

  • GetTaxonomyPolicy

  • SetTaxonomyPolicy

DataPolicy

DataPolicy permissions

  • CreateDataPolicy

  • ListDataPolicy

  • DeleteDataPolicy

  • GetDataPolicy

  • UpdateDataPolicy

  • GetDataPolicyPolicy

  • SetDataPolicyPolicy

  • MaskedGet

Project

Project permissions

  • GetProjectPolicy

  • SetProjectPolicy

  • SearchProject

Schema

Schema permissions

  • ListSchema

  • CreateSchema

  • UpdateSchema

  • DeleteSchema

  • GetSchema

  • GetSchemaPolicy

  • SetSchemaPolicy

Table

Table permissions

  • CreateTable

  • GetTable

  • UpdateTable

  • DeleteTable

  • ListTable

  • GetTableData

  • UpdateTableData

  • GetTablePolicy

  • SetTablePolicy

  • SetTableCategory

  • FineGrainedGet

  • CreateTableSnapshot

  • RestoreTableSnapshot

  • DeleteTableSnapshot

  • DownloadTableData

  • ReadLowFrequencyStorage

  • ReadLongTermStorage

  • RestoreColdStorage

Function

Function permissions

  • ListFunction

  • CreateFunction

  • UpdateFunction

  • DeleteFunction

  • GetFunction

  • GetFunctionPolicy

  • SetFunctionPolicy

Resource

Resource permissions

  • ListResource

  • CreateResource

  • UpdateResource

  • DeleteResource

  • GetResource

  • GetResourcePolicy

  • SetResourcePolicy

Model

Model permissions

  • CopyModel

  • ExportModel

  • EncryptModel

  • CreateModel

  • GetModel

  • UpdateModel

  • DeleteModel

  • ListModel

  • SetModelPolicy

  • GetModelPolicy

  • ExecuteModel

Connection

Connection permissions

  • ListConnection

  • CreateConnection

  • UpdateConnection

  • DeleteConnection

  • GetConnection

  • UseConnection

  • DelegateConnection

  • GetConnectionPolicy

  • SetConnectionPolicy

DataScan

DataScan permissions

  • CreateDataScan

  • UpdateDataScan

  • GetDataScan

  • DeleteDataScan

  • ListDataScan

  • TriggerDataScan

  • SetDataScanPolicy

  • GetDataScanPolicy

Catalog

ListCatalog

AccessControl

ExportAccessControl

SemanticSpec

SemanticSpec permissions

  • CreateSemanticSpec

  • GetSemanticSpec

  • UpdateSemanticSpec

  • DeleteSemanticSpec

  • ListSemanticSpec

  • GetSemanticSpecPolicy

  • SetSemanticSpecPolicy

Enable IAM permissions

The IAM permission model does not take effect by default. To use IAM permissions to control table data in a project, enable IAM permissions for the project by using one of the following methods:

Important

IAM permissions cannot be disabled after they are enabled.

  • New users: If no historical permission configurations exist, IAM permissions can be enabled for the project directly.

  • Existing users (pay special attention): If permissions are already managed by the existing permission model (policy/acl/package/label, etc.), complete all IAM permission configurations before enabling IAM permissions for the project.

  • Method 1: Enable IAM permissions in the MaxCompute console

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > Projects.

    3. On the Projects page, click Manage in the Actions column for the target project.

    4. On the Project Settings page, click the Parameter Configuration tab.

    5. In the Permission Properties section, click Edit, turn on Enable IAM Permissions, and then click Submit.

  • Method 2: Run the following command

    setproject odps.security.enablenamespaceprivilege=true;

Compatibility with the existing permission model

The following figure shows the compatibility between the IAM permission model and the existing permission model after IAM permissions are enabled. In the figure, namespace represents the IAM authorization model, and legacy represents the existing authorization models such as policy/acl/package.

image

When a data object (such as a table) is accessed, the system first performs IAM authorization checks:

  • The corresponding permissions are not granted through IAM: The system checks whether a PolicyTag is set on the object.

    • A PolicyTag is set: Access is denied.

    • No PolicyTag is set: The existing authorization model is used. Access is allowed if the access permission exists, and denied otherwise.

  • The corresponding permissions are granted through IAM: PolicyTag authorization checks are performed.

    • PolicyTag authorization fails: Access is denied.

    • PolicyTag authorization succeeds: The existing authorization model is used to check whether a deny configuration exists. Access is allowed if no deny configuration exists, and denied if a deny configuration exists.

Important
  • To use PolicyTag, authorization must be granted through the IAM permission model. Otherwise, after IAM permissions are enabled, data objects configured with PolicyTag cannot be accessed.

  • The entire authorization system follows the deny-first principle.

  • After IAM permissions are enabled for a project, the owner of each object in the project has all operation permissions on that object, regardless of the settings of the ObjectCreatorHasAccessPermission and ObjectCreatorHasGrantPermission parameters in the existing permission model.

Initialize administrators

In the initial state, only the Alibaba Cloud account has permissions to perform IAM permission management operations. For security reasons, the AccessKey of the Alibaba Cloud account cannot be used directly. The MaxCompute console provides an IAM permission administrator initialization feature, which uses RAM permissions to control the "initialize administrator" operation and configures RAM users as administrators.

Prerequisites

The RAM user or RAM role that performs the administrator initialization must have the following RAM permissions. Complete the authorization in the RAM console.

Operation category

Action

ARN

Description

Tenant management

odps:GetCatalogPolicy

acs:odps:{#regionId}:{#accountID}:odpscatalogpolicy/*

View authorizations

odps:ListCatalogPolicyMembers

acs:odps:{#regionId}:{#accountID}:odpscatalogpolicy/*

View the administrator list

odps:RemoveCatalogPolicyMember

acs:odps:{#regionId}:{#accountID}:odpscatalogpolicy/*

Remove administrator permissions

odps:SetCatalogPolicy

acs:odps:{#regionId}:{#accountID}:odpscatalogpolicy/*

Set administrator permissions

The following is a sample RAM policy:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "odps:RemoveCatalogPolicyMember",
        "odps:SetCatalogPolicy",
        "odps:GetCatalogPolicy",
        "odps:ListCatalogPolicyMembers"
      ],
      "Resource": "*"
    }
  ]
}

Grant the preceding policy to the RAM user or RAM role that needs to perform the administrator initialization.

Set administrators

After the RAM authorization is complete, the RAM user or RAM role with permissions to initialize administrators can initialize administrators by performing the following steps:

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > Tenants, and then click the Tenant Property tab.

  3. In the MaxCompute IAM Permissions Administrator section, click Add Member.

  4. In the Add Member dialog box, select the RAM users or RAM roles to be authorized as administrators.

    • Authorization scope

      • Tenant level (Tenant-Level Authorization): No selection is required. After the authorization is complete here, the administrator has all tenant-level permissions by default, including role management, Policy Tag management, and Connection management.

      • Project level (Project-Level Authorization): Optional. Specify the projects that the administrator can manage, including objects in the projects such as Schema and Table. If no project is specified, only tenant-level authorization is granted.

  5. Click OK to complete the administrator initialization.

Note

After the initialization is complete, the administrator has the built-in admin role by default. This role includes all permissions (Permissions).

Manage IAM roles

A role (Role) is used to define a custom role that contains a list of permissions (included Permissions). Bind a role to a Binding in a Policy to grant the role to specified members.

IAM roles can be managed in the following two ways:

  • Catalog API: Call the Role API of CatalogAPI to create, list, query, edit, and delete roles.

  • MaxCompute console:

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > IAM Permission, and then click the Role Management tab to manage roles in a visual interface.

Prerequisites

Whether IAM roles are managed through Catalog API or the console, the required permissions are MaxCompute IAM permissions, which currently cannot be controlled through RAM permissions. To perform all IAM role management operations, the following IAM permissions are required:

Resource type

Permission

Role

CreateRole, ListRole, DeleteRole, GetRole, UpdateRole, GetRolePolicy, SetRolePolicy

IAM role management permissions can be quickly obtained through Initialize administrators.

System predefined roles and permissions

IAM permissions provide the following predefined roles. These roles can be used directly and cannot be changed or deleted.

System predefined role

Permissions included

admin

All IAM permissions

connectionAdmin

All permissions in the Connection resource domain:

ListConnection, CreateConnection, UpdateConnection, DeleteConnection, GetConnection, UseConnection, DelegateConnection, GetConnectionPolicy, SetConnectionPolicy

connectionUser

Some permissions in the Connection resource domain:

ListConnection, GetConnection, UseConnection, GetConnectionPolicy

dataScanAdmin

All permissions in the DataScan resource domain:

CreateDataScan, UpdateDataScan, GetDataScan, DeleteDataScan, ListDataScan, TriggerDataScan, SetDataScanPolicy, GetDataScanPolicy

fineGrainedReader

Permission in the Table resource domain: FineGrainedGet

maskedReader

Permission in the DataPolicy resource domain: MaskedGet

searchUser

Permission in the Namespace resource domain: SearchNamespace

Permission in the Project resource domain: SearchProject

semanticSpecAdmin

All permissions in the SemanticSpec resource domain:

CreateSemanticSpec, GetSemanticSpec, UpdateSemanticSpec, DeleteSemanticSpec, ListSemanticSpec, GetSemanticSpecPolicy, SetSemanticSpecPolicy

Create a role

  • Catalog API: Call the Role API of CatalogAPI.

  • MaxCompute console:

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > IAM Permission. On the Role Management tab, click Create Role. Enter the Role Name and Description, select the required permissions, and then click OK to create the role.

      • Role Name: Must be unique within the namespace and is case-sensitive. Allowed characters: [a-z][A-Z][0-9]_. Length: [3, 255] bytes.

      • Description: Up to 1 KB.

      • Select Permissions: Select the list of permissions included in the role.

List roles

  • Catalog API: Call the Role API of CatalogAPI.

  • MaxCompute console:

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > IAM Permission. On the Role Management tab, view all roles in the specified Namespace, including predefined roles and custom roles.

Query a role

  • Catalog API: Call the Role API of CatalogAPI.

  • MaxCompute console:

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > IAM Permission. On the Role Management tab, click the role name, or click View or Edit in the Action column of the role to view all permissions of the role.

Edit a role

  • Catalog API: Call the Role API of CatalogAPI.

  • MaxCompute console:

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > IAM Permission. On the Role Management tab, click Edit in the Action column of the role, and modify the description and permissions of the custom role.

      Predefined roles can only be viewed and cannot be edited.

Delete a role

  • Catalog API: Call the Role API of CatalogAPI.

  • MaxCompute console:

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > IAM Permission. On the Role Management tab, click Delete in the Action column of the role.

      Predefined roles cannot be deleted.

Important

The deletion of a role takes effect immediately:

  • The role can no longer be bound to a Policy.

  • Policies that are bound to the role remain bound but have no effect.

  • List roles operations no longer list the deleted role by default.

A deleted role still counts toward the total quantity limit and remains in the deleted state for seven days. After seven days, the role is permanently deleted, all bindings between resources and the role are removed, and the role no longer counts toward the total quantity limit.

Control permissions on data resources

Bind IAM roles and users to project data resources to control data access.

Prerequisites

Whether operations are performed through Catalog API or the console, the required permissions are MaxCompute IAM permissions, which currently cannot be controlled through RAM permissions. To control permissions on data objects, the following IAM permissions are required:

Resource type

Permission

Role

ListRole, GetRole, GetRolePolicy, SetRolePolicy

DataPolicy

ListDataPolicy, GetDataPolicy, GetDataPolicyPolicy

Project

GetProjectPolicy, SetProjectPolicy, SearchProject

Schema

ListSchema, GetSchema, GetSchemaPolicy, SetSchemaPolicy

Table

GetTable, ListTable, GetTablePolicy, SetTablePolicy, SetTableCategory

Function

ListFunction, GetFunction, GetFunctionPolicy, SetFunctionPolicy

Resource

ListResource, GetResource, GetResourcePolicy, SetResourcePolicy

Model

GetModel, ListModel, SetModelPolicy, GetModelPolicy

Permissions to manage permissions on data objects can be quickly obtained through Initialize administrators with specific projects specified.

Manage authorizations

Call the APIs of objects such as Project, Schema, and Table in CatalogAPI to control data access, or perform visual operations on the Manage Configurations > Metadata Management page of the MaxCompute console.

Manage permissions on project-level data objects

In the console, permissions on project-level data objects can be managed, including viewing project-level permissions, adding authorizations, and removing authorizations.

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > Metadata Management.

  3. In the metadata directory tree on the left, click the project name to open the project metadata details page on the right. Click the Project Permission Details page of the project and perform authorization operations:

    • Add authorizations

      • Click Grant. In the New Authorization dialog box, select the IAM roles and user members to bind, and then click OK.

      • If an IAM role is already in the authorization list, click Member Management under the IAM role, select user members, and then click OK.

    • Remove authorizations

      • Click the delete icon of an IAM role to remove the permissions of the related members on the data objects of the project for the role.

      • Click the delete icon of a member under an IAM role to remove the permissions of the member on the data objects of the project for the role.

Important

After project-level authorization, members have the permissions of the corresponding role on all data objects in the project. Proceed with caution.

Manage permissions on Schema-level data objects

If the project uses the three-layer model (the project supports Schema; for more information, see Schema operations), permissions on Schema-level data objects can be managed in the console, including viewing Schema-level permissions, adding authorizations, and removing authorizations.

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > Metadata Management.

  3. In the metadata directory tree on the left, expand the project and click the Schema name to open the Schema metadata details page on the right. On the Schema Permission Details tab, perform authorization operations:

    • Add authorizations

      • Click Grant. In the New Authorization dialog box, select the IAM roles and user members to bind, and then click OK.

      • If an IAM role is already in the authorization list, click Member Management under the IAM role, select user members, and then click OK.

      • Authorizations can also be added to multiple Schemas in batches from the Schema list on the project metadata details page.

    • Remove authorizations: In the authorization list, perform the following operations:

      • Click the delete icon of an IAM role to remove the permissions of the related members on the data objects of the Schema for the role.

      • Click the delete icon of a member under an IAM role to remove the permissions of the member on the data objects of the Schema for the role.

Important

After Schema-level authorization, members have the permissions of the corresponding role on all data objects in the Schema. Proceed with caution.

Manage permissions on tables and views

In the console, permissions on tables or views can be managed, including viewing permissions, adding authorizations, and removing authorizations.

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > Metadata Management.

  3. In the metadata directory tree on the left, click the Table or View name under the project or Schema (if any) to open the table or view metadata details page on the right. On the Table Permission Details tab, perform authorization operations:

    • Add authorizations

      • Click Grant. In the New Authorization dialog box, select the IAM roles and user members to bind, and then click OK.

      • If an IAM role is already in the authorization list, click Member Management under the IAM role, select user members, and then click OK.

      • Authorizations can also be added to multiple Schemas in batches from the Schema list on the project metadata details page.

    • Remove authorizations: In the authorization list, perform the following operations:

      • Click the delete icon of an IAM role to remove the permissions of the related members on the table or view for the role.

      • Click the delete icon of a member under an IAM role to remove the permissions of the member on the table or view for the role.

Example

Prepare the environment

  • Prepare Alibaba Cloud accounts and projects:

    • Alibaba Cloud accounts (in the same RD): Aliyun_Account_A and Aliyun_Account_B.

    • Projects:

      • Aliyun_Account_A: project_a_1 and project_a_2.

      • Aliyun_Account_B: project_b_1.

  • Prepare RAM users:

    • Aliyun_Account_A: RAM$Aliyun_Account_A:manager, RAM$Aliyun_Account_A:developer, and RAM$Aliyun_Account_A:analyst.

    • Aliyun_Account_B: RAM$Aliyun_Account_B:analyst.

User role definitions

  • Security administrator (manager)

    • Responsibilities: Manage permission policies and data security policies.

    • Permissions: Create and delete roles and adjust permissions at the account level and project level; formulate and maintain data security policies; monitor and audit security events.

  • Data developer (developer)

    • Responsibilities: Perform data development tasks, including data processing, data pipeline development, and data model building.

    • Permissions: Data read and write permissions (import, export, modify, and delete); develop and maintain data processing workflows.

  • Data analyst (analyst)

    • Responsibilities: Perform data analysis, including query execution, report generation, and data visualization.

    • Permissions: Read-only data permissions (query data and generate reports); no permissions to modify or delete data.

Requirements

Data developers and data analysts need to perform data development and analysis on project_a_1 and project_a_2 of Aliyun_Account_A.

  • The developer of Aliyun_Account_A needs to perform data development in project_a_1 and project_a_2.

  • The analyst of Aliyun_Account_A performs data analysis in project_a_2 and needs query permissions on all tables in schema1 of project_a_1 and on all tables in project_a_2.

  • Aliyun_Account_B needs query permissions on all tables in schema1 of project_a_1.

Step 1: Initialize the security administrator

Use a RAM user or RAM role of Aliyun_Account_A that has the MaxComputeFullAccess RAM policy to log on to the MaxCompute console and initialize the security administrator RAM$Aliyun_Account_A:manager.

  1. Initialize the IAM permission security administrator.

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > Tenants, and then click the Tenant Property tab.

    3. In the MaxCompute IAM Permissions Administrator section, click Add Member.

    4. In the Add Member dialog box, select project_a_1 and project_a_2 as the projects, select RAM$Aliyun_Account_A:manager as the member, and then click OK.

  2. Initialize the project super administrator.

    This step is mainly used to manage and configure the CreateInstance permission. After IAM supports the CreateInstance permission, this step can be skipped.

    1. Log in to the MaxCompute console and select a region in the upper-left corner.

    2. In the left-side navigation pane, choose Manage Configurations > Projects. Perform the following operations on project_a_1 and project_a_2 separately: Click Manage in the Actions column of the project.

    3. In the Super Administrator section of the Parameter Configuration tab, click Edit, add the member RAM$Aliyun_Account_A:manager, and then click OK.

Step 2: Grant the CreateInstance permission

The security administrator RAM$Aliyun_Account_A:manager performs the following operations:

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > Projects. Perform the following operations on project_a_1 and project_a_2 separately: Click Manage in the Actions column of the project.

  3. On the Role Permissions tab, click Create Project-level Role to create the role runjob: Set the role type to Resource and the authorization model to ACL, expand the project and select only CreateInstance for the permissions, and then click OK.

  4. Return to the role permission list, click Manage Members for the runjob role, and add the following members:

    • project_a_1: RAM$Aliyun_Account_A:developer.

    • project_a_2: RAM$Aliyun_Account_A:developer and RAM$Aliyun_Account_A:analyst.

Step 3: Grant data access permissions

The security administrator RAM$Aliyun_Account_A:manager performs the following operations:

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > IAM Permission. On the Role Management tab, click Create Role to create the developer and analyst roles separately.

    • The permissions of developer are as follows:

      Resource type

      Permission

      Schema

      ListSchema, CreateSchema, UpdateSchema, DeleteSchema, GetSchema

      Table

      CreateTable, GetTable, UpdateTable, DeleteTable, ListTable, GetTableData, UpdateTableData, SetTableCategory, FineGrainedGet, CreateTableSnapshot, RestoreTableSnapshot, DeleteTableSnapshot, DownloadTableData

      Function

      ListFunction, CreateFunction, UpdateFunction, DeleteFunction, GetFunction

      Resource

      ListResource, CreateResource, UpdateResource, DeleteResource, GetResource, GetResourcePolicy, SetResourcePolicy

      Model

      CopyModel, ExportModel, EncryptModel, CreateModel, GetModel, UpdateModel, DeleteModel, ListModel, ExecuteModel

    • The permissions of analyst are as follows:

      Resource type

      Permission

      Table

      GetTable, ListTable, GetTableData

  3. In the left-side navigation pane, choose Manage Configurations > Metadata Management, and grant authorizations separately by binding users, roles, and data resources.

  4. Bind permissions on the data objects related to project_a_1:

    • Click project_a_1. On the Project Permission Details page that appears on the right, click Grant, select the developer role and the RAM$Aliyun_Account_A:developer account, and confirm the authorization.

    • Click schema1 under project_a_1. On the Schema Permission Details page that appears on the right, click Grant, select the analyst role and the RAM$Aliyun_Account_A:analyst and RAM$Aliyun_Account_B:analyst accounts, and confirm the authorization.

  5. Bind permissions on the data objects related to project_a_2:

    • Click project_a_2. On the Project Permission Details page that appears on the right, click Grant, select the developer role and the RAM$Aliyun_Account_A:developer account, and confirm the authorization.

    • Click Grant again, select the analyst role and the RAM$Aliyun_Account_A:analyst account, and confirm the authorization.

Step 4: Enable IAM permissions for the projects

Enable IAM permissions for project_a_1 and project_a_2. The security administrator RAM$Aliyun_Account_A:manager performs the following operations:

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > Projects. Perform the following operations on project_a_1 and project_a_2 separately: Click Manage in the Actions column of the project.

  3. In the Permission Properties section of the Parameter Configuration tab, click Edit, turn on the Enable IAM Permissions switch, and then click OK.

After all the preceding steps are complete, the related permissions are granted, and subsequent verification can be performed.