In this article
Add a new Permission to an already Existing Access Control list
URL
https://{{HOST}}/subscriptiontopic/{{topic_id}}/permissions/{{principal}}::{{permission}}/
Method
POST
Required IMS Scopes
- subscription_write
- apollo_write
URL Path Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| topic_id required |
Id of the topic to modify permission for | d8178fd0-35ed-499e-89ad-d5b13f0d4427 | string |
| principal | The principal to grant permissions to | sub:user:bob | string |
| permission | The permission level to grant | admin | string |
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authorization required |
Bearer {access_token} | IMS access token |
| Content-Type required |
application/json | Content Type |
Example
Request
curl -X POST
'https://{{HOST}}/subscriptiontopic/{{topic_id}}/permissions/sub:user:bob::admin'
-H 'Authorization: Bearer {access_token}'
Response
{
"objectId": "TestTopicId",
"accesscontrolitems": {
"sub:user:bob": "owner",
"org:jci.com": "readwrite",
"principal": "permission"
}
}
Notes
Where principal is one of sub:user:USERID, sub:dev:DEVICEID, sub:app:APPID, org:ORGID, group:ORGID:GROUPID and permission is one of owner, admin, readwrite, readonly.
Errors
| Error | Description |
|---|---|
| 401 | Unauthorized |
| 400 | Update will leave ACL in invalid state |
| 403 | Forbiden. Possible causes: You do not have access to this endpoint (scope) You do not have access to this topic) |
| 504 | Timeout while attempting to write topic to storage repository |
Response Body Parameters
| Name | Description | Schema |
|---|---|---|
| id | Id of the topic object | string |
| accesscontrolitems | Current list of access permissions for topic | object definition |