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.