Performs Permission Operations on resource

post

/content/management/api/v1.1/permissionOperations

Performs permission operations on resource with given payload.

Request

Supported Media Types
Query Parameters
Header Parameters
  • 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" ]
  • A custom header to mitigate CSRF attacks.
    Allowed Values: [ "XMLHttpRequest" ]
Body ()
Details of the permission operations.
Root Schema : PermissionOperations
Type: object
Permission Operations
Show Source
Nested Schema : PermissionOperationsActions
Type: object
Operations that can be performed. Currently only one operation at a time is supported.
Show Source
Nested Schema : SharePermission
Type: object
Details of the share operation
Show Source
Nested Schema : UnSharePermission
Type: object
Details of the unshare operation
Show Source
Nested Schema : failedRoles
Type: array
failed share list.
Show Source
Nested Schema : ResourceId
Type: object
ResourceId
Show Source
Nested Schema : roles
Type: array
details of the roles to be granted.
Show Source
Nested Schema : successRoles
Type: array
successful share list.
Show Source
Nested Schema : FailedSharePermissionRole
Type: object
Details of share operation role failed.
Show Source
Nested Schema : users
Type: array
Show Source
Nested Schema : FailedUserId
Type: object
FailedUserId
Show Source
Nested Schema : SharePermissionRole
Type: object
Details of share operation role.
Show Source
Nested Schema : users
Type: array
Show Source
Nested Schema : UserId
Type: object
UserId
Show Source
Nested Schema : SuccessSharePermissionRole
Type: object
Details of successful share operation role.
Show Source
Nested Schema : users
Type: array
Show Source
Nested Schema : failedUsers
Type: array
Show Source
Nested Schema : successUsers
Type: array
Show Source
Nested Schema : users
Type: array
Show Source
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : PermissionOperations
Type: object
Permission Operations
Show Source
Nested Schema : PermissionOperationsActions
Type: object
Operations that can be performed. Currently only one operation at a time is supported.
Show Source
Nested Schema : SharePermission
Type: object
Details of the share operation
Show Source
Nested Schema : UnSharePermission
Type: object
Details of the unshare operation
Show Source
Nested Schema : failedRoles
Type: array
failed share list.
Show Source
Nested Schema : ResourceId
Type: object
ResourceId
Show Source
Nested Schema : roles
Type: array
details of the roles to be granted.
Show Source
Nested Schema : successRoles
Type: array
successful share list.
Show Source
Nested Schema : FailedSharePermissionRole
Type: object
Details of share operation role failed.
Show Source
Nested Schema : users
Type: array
Show Source
Nested Schema : FailedUserId
Type: object
FailedUserId
Show Source
Nested Schema : SharePermissionRole
Type: object
Details of share operation role.
Show Source
Nested Schema : users
Type: array
Show Source
Nested Schema : UserId
Type: object
UserId
Show Source
Nested Schema : SuccessSharePermissionRole
Type: object
Details of successful share operation role.
Show Source
Nested Schema : users
Type: array
Show Source
Nested Schema : failedUsers
Type: array
Show Source
Nested Schema : successUsers
Type: array
Show Source
Nested Schema : users
Type: array
Show Source

202 Response

Accepted.

400 Response

Bad request.

403 Response

Forbidden.

404 Response

Not found.

500 Response

Internal server error.
Back to Top

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"}
                ]
              }
            ]
          }
        }
      }
Back to Top