Apply application permission policy¶
Save the complete application permission policy for a role. Saving replaces the role’s existing application permission policy, so confirm the policy content and role status first.
PUT $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/roles/{role_id}/application-policy
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First select a role and confirm that its policy can be modified. Then view the permission schema to choose supported actions, resource types, and grant scopes. Finally, view the role permission view and prepare the complete change based on the current policy state.
Request parameters¶
curl -X PUT "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/application-policy" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d "{
\"schema_version\": \"$SCHEMA_VERSION\",
\"expected_policy_version\": 1,
\"expected_role_lifecycle_version\": 1,
\"request_id\": \"req-001\",
\"statements\": [
{
\"action_id\": \"workflow.read\",
\"resource_type\": \"workflow\",
\"scope_mode\": \"all\"
}
]
}"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
|
string |
Yes |
ID of the role whose policy is updated. |
Request body
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Version of the permission schema used by this policy. |
|
integer |
No |
Policy version used for concurrency checks; cannot be less than 0. |
|
integer |
Yes |
Current role lifecycle version; must be greater than 0. |
|
string |
Yes |
Caller-generated idempotency request ID. |
|
object array |
Yes |
Complete policy statements to save. An empty array saves an empty policy. |
|
string |
No |
Statement ID. The service generates one when omitted. |
|
string |
Yes |
Action ID in the permission schema. |
|
string |
Yes |
Resource type that matches the action. |
|
string |
Yes |
Resource scope: |
|
string |
No |
Resource ID used when |
|
string |
No |
Hash of the condition expression. |
|
string |
No |
Target action ID when granting a permission. |
|
string |
No |
Delegable scope: |
|
boolean |
No |
Whether further delegation is allowed. |
Successful response¶
On success, the policy is saved as requested and a new policy version is returned. Replaying the same request ID with identical content does not increment the version again.
{
"code": "OK",
"msg": "OK",
"data": {
"role_id": "role-001",
"policy_version": 2,
"idempotent_replay": false,
"request_id": "req-001",
"trace_id": "trace-001"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
ID of the role whose policy was updated. |
|
integer |
Policy version after saving. |
|
boolean |
Whether this is an idempotent replay of the same request. |
|
string |
Request correlation ID. |
|
string |
Trace ID. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "Invalid request parameters",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Error message. |
|
null |
— |