SOAP permissions error

Igor Totic March 14, 2018

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

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 14, 2018

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

Jelena Radovanovic March 14, 2018

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

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events