how to give page restriction for read and update for specific user every time give error
"Not enough permissions to alter ContentRestrictions on a content with ContentId <33266>"
i use php for add resticriction api
my code is
$headers = array(
'Accept' => 'application/json',
'Content-Type' => 'application/json'
);
$body = <<<REQUESTBODY
[
{
"operation": "read",
"restrictions": {
"user": [
{
"type": "known",
"accountId": "557058:5186bd2a-2624-417f-a473-1bf35553d587"
}
]
}
}
]
REQUESTBODY;
$response = Unirest\Request::put(
'https://akshayshah.atlassian.net/wiki/rest/api/content/33266/restriction?expand=restrictions.user',
$headers,
$body
);
echo '<pre/>';
print_r($response);
and response is
Unirest\Response Object ( [code] => 403 [raw_body] => {"statusCode":403,"data":{"authorized":false,"valid":false,"errors":[{"message":{"translation":"Not enough permissions to alter ContentRestrictions on a content with ContentId <33266>","args":[]}}],"successful":false},"message":"com.atlassian.confluence.api.service.exceptions.PermissionException: Not enough permissions to alter ContentRestrictions on a content with ContentId <33266>"} [body] => stdClass Object ( [statusCode] => 403 [data] => stdClass Object ( [authorized] => [valid] => [errors] => Array ( [0] => stdClass Object ( [message] => stdClass Object ( [translation] => Not enough permissions to alter ContentRestrictions on a content with ContentId <33266> [args] => Array ( ) ) ) ) [successful] => ) [message] => com.atlassian.confluence.api.service.exceptions.PermissionException: Not enough permissions to alter ContentRestrictions on a content with ContentId <33266> ) [headers] => Array ( [0] => HTTP/2 403 [server] => AtlassianProxy/1.15.8.1 [vary] => Accept-Encoding [cache-control] => no-cache, no-store, must-revalidate [content-type] => application/json [content-encoding] => gzip [strict-transport-security] => max-age=315360000; includeSubDomains; preload [date] => Sat, 02 May 2020 16:42:47 GMT [atl-traceid] => 6cf5cd78978f76ef [expires] => Thu, 01 Jan 1970 00:00:00 GMT [x-xss-protection] => 1; mode=block [x-content-type-options] => nosniff [atl-confluence-via] => h:confluence-prod-ap-4-2.prod.atl-paas.net [expect-ct] => report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400 ) )
Hello there! I understand, you need to alter permissions via PHP but the procedure fails each time due to some error.
Looking at the request, this sounds like a development question. Our Developer community might be better suited to take care of your request.
You can take a look here:
Thanks @Akshay Shah!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.