Update restrictions
Sets all the restrictions specified to a piece of content identified by contentId. Setting per-content restrictions is currently allowed for Pages or BlogPosts only.
Example request URI:
http://example.com/confluence/rest/content/1234567/restriction?expand=
The payload uses the same schema as returned by the GET requests from /rest/api/content/{id}/restriction/byOperation* which can be used as a template but is not necessary.
Example request for a single content restriction:
[ { "operation": "update", "restrictions": { "user": [ { "type": "known", "username": "admin" } ] } } ]
Example request for updating two ContentRestrictions:
[ { "operation": "update", "restrictions": { "user": [ { "type": "known", "username": "admin" } ] } }, { "operation": "read", "restrictions": { "user": [ { "type": "known", "username": "fred" } ] } } ]
Rules for using this method:
- The provided ContentRestrictions will overwrite any existing restrictions on the Content for the corresponding operations.
- If the provided
ContentRestrictionlacks any supported operations, the restrictions for the operations will not be altered. - Setting
usersand/orgroupsmap entries as empty arrays will remove the corresponding content restrictions. - Missing
usersand/orgroupsmap entries means the corresponding operation’s user/group content restrictions won’t be changed. - Modifying restrictions to revoke the requesting user’s access is prohibited.
/rest/api/content/{id}/restrictionidstringrequiredThe id of the content
expandstringA comma separated list of properties to expand in the response. Default is <code>restrictions.user, restrictions.group</code> Default value: group.
limitstringpagination limit.
startstringpagination start.
application/jsonContentRestrictioncontentReferenceContentShow propertiesHide properties
expandedbooleanidPropertiesobjectoperationstringrestrictionsobjectReturns a full JSON representation of the restrictions present directly on piece of content after the update operation.
resultsOperationRestriction[]Show propertiesHide properties
OperationRestrictionoperationstringThe operation type
restrictionsRestrictionsShow propertiesHide properties
userPageResponseObjectShow propertiesHide properties
resultsobject[]Results of the page response
startinteger<int32>Start index of the page response
limitinteger<int32>Limit of the page response
sizeinteger<int32>Size of the results
groupPageResponseObjectShow propertiesHide properties
resultsobject[]Results of the page response
startinteger<int32>Start index of the page response
limitinteger<int32>Limit of the page response
sizeinteger<int32>Size of the results
get_linksLinksShow propertiesHide properties
selfstringSelf link
basestringBase link
contextstringContext link
get_expandableExpandableShow propertiesHide properties
contentstringContent link
startnumberlimitnumbersizenumber_linksobjectShow propertiesHide properties
basestringselfstringcontextstringnextstringprevstringReturned if any of the above validation rules are violated.
statusCodeinteger<int32>dataValidationResultShow propertiesHide properties
authorizedbooleanvalidbooleanerrorsobjectsuccessfulbooleanallowedInReadOnlyModebooleanmessagestringreasonstringReturned if the calling user is not authenticated.
statusCodeinteger<int32>dataValidationResultShow propertiesHide properties
authorizedbooleanvalidbooleanerrorsobjectsuccessfulbooleanallowedInReadOnlyModebooleanmessagestringreasonstringReturned if the calling user does not have permission to edit the restrictions.
statusCodeinteger<int32>dataValidationResultShow propertiesHide properties
authorizedbooleanvalidbooleanerrorsobjectsuccessfulbooleanallowedInReadOnlyModebooleanmessagestringreasonstringReturned if there is no content with the given id, or if the calling user does not have permission to view the content.
statusCodeinteger<int32>dataValidationResultShow propertiesHide properties
authorizedbooleanvalidbooleanerrorsobjectsuccessfulbooleanallowedInReadOnlyModebooleanmessagestringreasonstring