Annotation Collaborator Permissions

Hi,


We have a Salesforce/GroupDocs implementation that currently assigns the user “ALL” permissions when they are assigned as a collaborator. The code we use is:

public void setCollaborator(String fileId, GD_ReviewerInfo info) {
GD_GroupDocsSecurityHandler securityHandler = new GD_GroupDocsSecurityHandler(GD_Utils.privateKey);
GD_ApiClient api = new GD_ApiClient(securityHandler);
GD_AntApi antApi = new GD_AntApi(api);

//Check if the user is already a collaborator
GD_GetCollaboratorsResponse userResp = antApi.GetAnnotationCollaborators(GD_Utils.clientId, fileId);
List<GD_ReviewerInfo> reviewers = userResp.result.collaborators;
for (GD_ReviewerInfo reviewer : reviewers) {
if (!info.primary_email.equalsIgnoreCase(reviewer.primary_email)) { // If the user is not already a collaborator
//We havent found a collaborator…lets add this user
GD_AddCollaboratorResponse collabresponse = antApi.AddAnnotationCollaborator(GD_Utils.clientId, fileId, info);
}
}
List<GD_ReviewerInfo>userInfo = new List<GD_ReviewerInfo>();
userInfo.add(info);
GD_SetReviewerRightsResponse response = antApi.SetReviewerRights(GD_Utils.clientId, fileId, userInfo);
}

And the info object that we’re passing into this method looks like:

GD_ReviewerInfo info = new GD_ReviewerInfo();
info.primary_email = user.primary_email;
info.firstName = user.firstname;
info.lastName = user.lastname;
info.access_rights = ‘63’;
info.guid = user.guid;
info.color = 16711680;

The customer has demoed this and requested that we limit the access_rights to allow users to Annotate, and only delete/edit their own annotations. I’ve tried changing info.access_rights = ‘63’; to 8, 32, etc…and every time I change it from something other than 63, the user loses all permissions and cannot even annotate the document.

Also, once the document hits a certain status in Salesforce, they want to remove all annotating permissions from the document for all collaborators, but make it viewable (including the ability to view the annotations). Is this possible? Thanks.

Hello,


Thank you for this request. To set required user’s rights please try to set it to 35.

As for the second question - when your document hits a certain status you should set user rights to 1 for all collaborators.

Best regards.

Thanks for responding. When I set the collaborator permissions to 35, the collaborators are still able to delete each others annotations. Is there a different property I should be setting?

Hello,


Thank you for coming back. Unfortunately no, if user added as collaborator he can delete annotations. The only way to deny him to delete annotations is to set his rights to CanView or 1.

Best regards.

Just to confirm, there is no way a user can be added as an annotation collaborator and not be able to edit/delete everyone else’s annotations?


That would seem like a pretty basic permission set to me. This is going to be a deal breaker if so.

Thanks.

Hello,


In case you added collaborator and you want that he should be able to annotate - then yes, he will be able to delete annotations.

Best regards.