ApplyResourceAccessPermission

Updated at:

Submits an application for access permissions to specific resources.

Operation description

Request description

  • Reason: The reason for the application. This parameter is required.

  • ApplyContents: The list of resource permission applications. Each item includes the resource description (Resource), grantee description (Grantee), access types (AccessTypes), and expiration time (ExpirationTime). The maximum number of items per request is 400.

  • Resource: The resource description. You must specify the ResourceSchema.name and version on which resource parsing depends, as well as the resource metadata (MetaData).

  • Grantee: The grantee description. You must specify the principal type (PrincipalType) and principal ID (PrincipalId).

  • AccessTypes: The list of permission types. Multiple permission combinations are supported.

  • ExpirationTime: The expiration time of the permissions, provided as a millisecond timestamp.

  • AuthMethod: The authorization method. This parameter is optional. By default, the built-in default authorization method is used.

  • ClientToken: The client token used to prevent duplicate requests. This parameter is optional.

Make sure that all required fields are correctly filled in and meet the corresponding constraints. For example, the DefVersion and MetaData in Resource must match the selected DefSchema.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:ApplyResourceAccessPermission

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Reason

string

Yes

The reason for the application.

Business development requirements

ApplyContents

array<object>

Yes

The list of resource permission applications.

array<object>

No

Resource

object

No

The resource description.

DefSchema

string

Yes

The resource type.

Note: The resource types supported by the system are constrained by ResourceSchema.name.

Appendix: ResourceSchema documentation

Valid values:

  • LINDORM :

    LINDORM

  • MaxCompute :

    MaxCompute

  • EMR_ON_ECS_HIVE :

    EMR_ON_ECS_HIVE

  • DLF_V1 :

    DLF_V1

  • HOLOGRES :

    HOLOGRES

  • SEVERLESS_STARROCKS :

    SEVERLESS_STARROCKS

  • DATAWORKS_ENTITY :

    DATAWORKS_ENTITY

  • DLF_NEXT :

    DLF_NEXT

MaxCompute

DefVersion

string

No

The resource parsing version is constrained by ResourceSchema.version.

ResourceSchema documentation

v1.0.0

MetaData

object

No

The resource metadata declaration.

Note: The metadata is constrained by ResourceSchema.resources. A valid resource declaration must include metadata for the full resource path from level 0 through the validLeaf level.

Appendix: ResourceSchema documentation

{"workspace": "449656", "project": "sync_destination", "table": "order_table", "threeTierModel": false}

any

No

Declares specific resources in the Map<String,Object> format, which must comply with the resource constraints of the specific resource type in ResourceSchema.

Note:

  1. When applying for MaxCompute column permissions, label authorization is performed only if the column security level columnSensibleLevel is declared at the same time.

  2. For MaxCompute permission applications with Schema enabled, you must pass the threeTierModel parameter and set it to true.

{ "workspace": "449656", "project": "sync_destination", "table": "order_table", "threeTierModel": false }

Grantee

object

Yes

The grantee description.

Note: The principal types supported by the system are constrained by ResourceSchema.authPrincipal.

Appendix: ResourceSchema documentation

PrincipalType

string

Yes

The principal type. Valid values:

  • RamRole

  • RamUser

  • DlfRole

Valid values:

  • DlfRole :

    DlfRole

  • RamUser :

    RamUser

  • RamRole :

    RamRole

RamRole

PrincipalId

string

Yes

The principal ID. The mapped IDs have different semantics for different principal types:

  • RamUser: the DataWorks user ID.

  • RamRole: the DataWorks user ID that starts with "ROLE_".

  • DlfRole: the DlfNext role name.

ROLE_32237475848545

AccessTypes

array

Yes

The list of requested permissions.

Note: The types of permissions that can be applied for vary across resources at different levels. All are constrained by ResourceSchema.isValidLeaf, accessTypeRestrictions, and authMethodAccessTypes.

Appendix: ResourceSchema documentation

string

No

The resource permission.

select

ExpirationTime

integer

No

The expiration time of the permissions, specified as a millisecond timestamp.

1785835708000

AuthMethod

string

No

The authorization method. Currently, only SEVERLESS_STARROCKS supports specifying the authorization method: ranger and starrocksManager.

Note: The authorization methods supported vary across resources. All are constrained by ResourceSchema.authMethods.

Appendix: ResourceSchema documentation

Valid values:

  • starrocksManager :

    Starrocks Manager

  • ranger :

    Ranger

ranger

ClientToken

string

No

The idempotency token used to prevent duplicate operations caused by multiple calls.

ABFUOEUOTRTRJKE

Response elements

Element

Type

Description

Example

object

The response structure.

RequestId

string

The request ID. Used to locate logs and troubleshoot issues.

0bc5df3a17***903790e8e8a

Data

array

The list of application IDs.

string

The application or approval process ID.

332066440109224007

Examples

Success response

JSON format

{
  "RequestId": "0bc5df3a17***903790e8e8a",
  "Data": [
    "332066440109224007"
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.