We are using SOAP Confluence API for setting permissions on Confluence pages (Edit permission).
Confluence version is 5.9.7.
Recently, we are facing problems with Confluence (without any change on application side).Error in Confluence log: Failure executing remote method [setContentPermissions]: Content permission type does not match supplied permission type
We are unable to troubleshoot this error and we made sure that the error is not on the application's side.
Any help would be appreciated.
Thanks
Hi Igor,
For your information, SOAP has been deprecated since 5.5 and may not work as expected.
Could you let us know exactly what query you were using to set it, and if it worked previously?
Regards,
Shannon
Hi Shannon,
As far as we know, there is no REST API call for setting restriction to the page, is that right? So we have to use SOAP API calls.
This is a part of the code that we are using:
RemoteContentPermission permission = new RemoteContentPermission();
permission.type = restriction;
permission.userName = userName;
permission.groupName = null;
permissions.Add(permission);
RemoteContentPermissionSet[] permissionSets = service.getContentPermissionSets(token, pageId);
var existingPermissions = new List<RemoteContentPermission>();
foreach (var permissionSet in permissionSets)
{
existingPermissions.AddRange(permissionSet.contentPermissions);
}
existingPermissions.Add(permission);
service.setContentPermissions(token, pageId, restriction, existingPermissions.ToArray());
where restriction is "View" or "Edit".
This is only for user permission, we are using same method for group permission.
Regards,
Jelena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jelena,
That's correct; there isn't a method in REST API currently.
If you're getting the same error as Igor was, is it possible that the user you're trying to give permissions to doesn't have permissions on the space itself?
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.