Attach Policy to User/User Group/Service Account


Attach policies to a user, user group, or service account.

Operation Permissions

Applications assigned with the administrator policy in the OU.

Request Format

POST https://{apigw-address}/enos-iam-service/v2.3/policy/grant

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The ID of the organization to which the user/user group/service account belongs to. How to get orgId>>

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

subjectIds

Mandatory

String

The ID of the user/user group/service arrount to attach the policy to. subjectIds has to align with the subjectType.

subjectType

Mandatory

String

The subject type. Available values are: user, user_group, and app_instance. subjectType has to align with the subjectIds.

policy

Mandatory

AddPolicy Struct

The information of the policies to be attached. For more information, see AddPolicy Struct.

Samples

Request Sample

url: https://{apigw-address}/enos-iam-service/v2.3/policy/grant?orgId=yourOrgId
method: POST
request Body:
{
  "policy": {
    "add": [
      "123"
    ]
  },
  "subjectIds": "userId359",
  "subjectType": "user"
}

Return Sample

{
  "fail": false,
  "data": true,
  "success": true,
  "status": 0
}