Patch authorization rules
Performs a set of rule management actions as specified in a JSON patch. The actions are performed synchronously and transactionally. A resource collection of all created and revised rules is returned. If the patch is not successfully applied, changes are rolled back.
For every action, the patch must specify an operation (add, replace, remove, test, or copy) and a target URI (for example, /authorization/rules/{ruleId} or, to create a new rule, /authorization/rules). Each add and replace operation requires a valid rule representation. Each copy operation requires a 'from' URI that identifies the original rule.
You cannot save duplicate rules, so a patch that includes a copy operation must also include an operation that modifies or deletes either the original rule or the new rule.
You can combine operations to migrate existing rules. For example, you might copy a rule, then update the new rule (using the 'replace' operation), and then delete the original rule.
New rules that do not yet have known rule IDs are added to a zero-indexed ordered list. To reference such rules, use the substitution token @CREATED#@ (where '#' is the index of the target rule).
1[2 [3 {4 "op": "test",5 "path": "/authorization/rules/e7ae0810-a47d-11e7-abc4-cec278b6b50a",6 "value": {7 "type": "grant",8 "permissions": [9 "read",10 "update"11 ],12 "objectUri": "/identities/**",13 "principalType": "authenticated-users"14 }15 },16 {17 "op": "add",18 "path": "/authorization/rules/e7ae0810-a47d-11e7-abc4-cec278b6b50a",19 "value": {20 "permissions": [21 "read",22 "update, delete, secure"23 ],24 "objectUri": "/identities/*"25 }26 }27 ]28]
JSON patch describing operations to perform and identifying the target rules.
Array of patch operations to apply to the existing rules.
Name | Type | Required | Description |
---|---|---|---|
value | Authorization Rule | false | An authorization rule that does not have a known ID. The rule has not been saved or the ID is unavailable for some other reason. Compare with SavedAuthorizationRule. |
op | string | true | The type of operation to perform on the defined rule. Allowed values: addreplaceremovetestcopy |
path | string | true | The URI of the rule. |
Status | Meaning | Description | ||
---|---|---|---|---|
200 | OK | The request succeeded. Returned if the patch was applied successfully. | Schema | |
400 | Bad Request | The request was invalid. Returned if the specified rule patch is invalid. | Schema | |
412 | Precondition Failed | Precondition failed | Schema | |
422 | Unprocessable Entity | Returned if the patch request is syntactically valid but would result in a resource state that is inconsistent or invalid. | Schema | |
428 | Precondition Required | Precondition required | Schema |