Performs Permission Operations on resource
/content/management/api/v1.1/permissionOperations
Request
- application/json
-
links(optional): string
This parameter accepts a comma-separated list of link names. By default, this parameter gives all the links applicable. Possible values are: self, canonical, describedby
-
Prefer(optional): string
This parameter is used to control the interaction type (synchronous/asynchronous) of the request. If the header is provided with value respond-async, it indicates that asynchronous interaction is preferred. Otherwise, synchronous interaction is preferred. Asynchronous request is responded with 202 status with a status link in the location header. Synchronous request is responded with 200 along with response body.Allowed Values:
[ "respond-async" ]
-
X-Requested-With: string
A custom header to mitigate CSRF attacks.Allowed Values:
[ "XMLHttpRequest" ]
object
-
links(optional):
array links
Links of the permission operations resource.
-
operations(optional):
object PermissionOperationsActions
Operations that can be performed. Currently only one operation at a time is supported.
array
-
Array of:
object Link
Link of the resource.
object
object
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
object
-
id(optional):
string
id of the resource.
-
name(optional):
string
Name of the resource.
-
type(optional):
string
Allowed Values:
[ "repository", "collection", "channel", "type", "workflow", "scheduledjob", "translationjob", "editorialrole", "publishingrole", "siteplan", "taxonomy", "retentionpolicy", "hold" ]
Type of the resource.
object
-
groupType(optional):
string
Allowed Values:
[ "CEC", "IDP" ]
-
message(optional):
string
failure message.
-
name(optional):
string
-
type(optional):
string
Allowed Values:
[ "user", "group" ]
object
-
groupType(optional):
string
Allowed Values:
[ "CEC", "IDP" ]
-
name(optional):
string
-
type(optional):
string
Allowed Values:
[ "user", "group" ]
Response
- application/json
200 Response
object
-
links(optional):
array links
Links of the permission operations resource.
-
operations(optional):
object PermissionOperationsActions
Operations that can be performed. Currently only one operation at a time is supported.
array
-
Array of:
object Link
Link of the resource.
object
object
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
object
-
id(optional):
string
id of the resource.
-
name(optional):
string
Name of the resource.
-
type(optional):
string
Allowed Values:
[ "repository", "collection", "channel", "type", "workflow", "scheduledjob", "translationjob", "editorialrole", "publishingrole", "siteplan", "taxonomy", "retentionpolicy", "hold" ]
Type of the resource.
object
-
groupType(optional):
string
Allowed Values:
[ "CEC", "IDP" ]
-
message(optional):
string
failure message.
-
name(optional):
string
-
type(optional):
string
Allowed Values:
[ "user", "group" ]
object
-
groupType(optional):
string
Allowed Values:
[ "CEC", "IDP" ]
-
name(optional):
string
-
type(optional):
string
Allowed Values:
[ "user", "group" ]
202 Response
400 Response
403 Response
404 Response
500 Response
Examples
The following example shows how to perform permission operations on resource with given payload by submitting a POST request on the REST resource using cURL.
curl -X POST -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' 'https://host:port/content/management/api/v1.1/permissionOperations'
Example 1:
Share a repository with id E1F4F961C7224422B0998434E4F4572E to a user in a synchronous way. Here the shared role is a custom editorial role with id 94950193E96940D7980FA8BA47E73491. Replace payload with your own data.
/content/management/api/v1.1/permissionOperations?links=none
Request Payload
{ "operations": { "share": { "resource": { "id": "E1F4F961C7224422B0998434E4F4572E", "name": "repository7", "type": "repository" }, "roles": [ { "message": "message1", "users": [ { "name": "cecuserLoginIdName2", "type": "user" } ], "id": "94950193E96940D7980FA8BA47E73491", "name": "Custom Editorial Role3", "type": "editorial" } ] } } }
Response Body
{ "operations": { "share": { "resource": { "id": "E1F4F961C7224422B0998434E4F4572E", "name": "repository7", "type": "repository" }, "roles": [ { "id": "94950193E96940D7980FA8BA47E73491", "name": "Custom Editorial Role3", "type": "editorial", "message": "message1", "users": [ { "name": "cecuserLoginIdName2", "type": "user" } ] } ], "successRoles": [ { "id": "94950193E96940D7980FA8BA47E73491", "name": "Custom Editorial Role3", "type": "editorial", "users": [ { "name": "cecuserLoginIdName2", "type": "user" } ] } ] } }
Example 2:
Share a custom editorial role with id 7EFD29110FE041ADAC888CCFAEE2923B to users in a synchronous way. The shared role must be manager. Replace payload with your own data.
/content/management/api/v1.1/permissionOperations?links=none
Request Payload
{ "operations": { "share": { "resource" : { "id" : "7EFD29110FE041ADAC888CCFAEE2923B", "name": "Custom Editor Role", "type" : "editorialRole" }, "roles": [ { "name" : "manager", "message" : "message1", "users" : [ {"name" : "cecuserLoginIdName1", "type" : "user"}, {"name" : "cecgroupLoginIdName1", "type" : "group"} ] } ] } } }
Response Body
{ "operations": { "share": { "resource": { "id": "7EFD29110FE041ADAC888CCFAEE2923B", "name": "Custom Editor Role", "type": "editorialRole" }, "roles": [ { "name": "manager", "message": "message1", "users": [ { "name": "cecgroupLoginIdName1", "type": "group", "groupType": "CEC" }, { "name": "cecuserLoginIdName1", "type": "user" } ] } ], "successRoles": [ { "name": "manager", "users": [ { "name": "cecgroupLoginIdName1", "type": "group", "groupType": "CEC" }, { "name": "cecuserLoginIdName1", "type": "user" } ] } ] } }
Example 3:
Share a scheduled job to users in an asynchronous way. Here ae071059448e4c7898cd5b303fc6017e is id of the scheduled job. Replace payload with your own data.
/content/management/api/v1.1/permissionOperations
Request Payload
{ "operations": { "share": { "resource" : { "id" : "ae071059448e4c7898cd5b303fc6017e", "type" : "scheduledJob" }, "roles": [ { "name" : "manager", "message" : "message1", "users" : [ {"name" : "ssvrint.admin1", "type" : "user"}, {"name" : "ssvrint.siteadmina", "type" : "user"} ] } ] } } }