Hi support,
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Hi Evgen,
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Hi Evgen,
// create service
GroupdocsService service = new GroupdocsService(basePath, userId, privateKey);
....
// create user
UserInfo user = new UserInfo();
RoleInfo role = new RoleInfo();
RoleInfo[] roleList = new RoleInfo[1];
// Fill the role information
role.Id = 3;
role.Name = "User";
roleList[0] = role;
// Limit the length of the names (feature of GroupDocs)
if (firstName.Length > 20)
firstName = firstName.Substring(0, 20);
if (lastName.Length > 20)
lastName = lastName.Substring(0, 20);
// Fill the user information
user.NickName = firstName;
user.FirstName = firstName;
user.LastName = lastName;
user.PrimaryEmail = emailAddress;
user.Roles = roleList;
.....
// add the user
UserIdentity newCoach = service.UpdateAccountUser(coachInfo);
Please advice me how to change this.
Regards,
Jeroen
Thank you for your response, Pavel,
// Add collaborators
String[] emails = new String[2];
emails[0] = collaboratorEmail1;
emails[1] = collaboratorEmail2;
Groupdocs.Api.Contract.Annotation.SetCollaboratorsResult result = service.SetAnnotationCollaborators(externalFileStore.FileId, emails, "2.0");
if (result.Collaborators != null)
{
Groupdocs.Api.Contract.Annotation.SetReviewerRightsResult setReviewer = service.SetReviewerRights(externalFileStore.FileId, result.Collaborators);
}
And here is the code to create the collaboration url:
// set up the base path
StringBuilder iFrameUrl = new StringBuilder();
iFrameUrl.Append(AppSettings["GroupdocsAnnotationUrl"]);
ExternalFileStore storedFile = GetExternalFileStore();
// add the proper file
iFrameUrl.Append(storedFile.FileId);
if (presenterRole)
{
// the coach is viewing this page
iFrameUrl.Append("?uid=");
iFrameUrl.Append(storedFile.PresenterId);
iFrameUrl.Append("&master=true");
}
else
{
iFrameUrl.Append("?uid=");
iFrameUrl.Append(storedFile.ViewerId);
}
String privateKey = AppSettings["GroupdocsPrivateKey"];
Frame.Src = Groupdocs.Security.UrlSignature.Sign(iFrameUrl.ToString(), privateKey);
Hi,
Thank you for the quick response. We checked the code and found out that after adding a collaborator you have set reviewers rights for the new user – you shouldn’t do that. As you can see from our code example http://prntscr.com/4w134z we just add a collaborator and then set a new user GUID as a uid value in the URL.
Please replace this code line:
Groupdocs.Api.Contract.Annotation.SetReviewerRightsResult setReviewer = service.SetReviewerRights(externalFileStore.FileId, result.Collaborators);
with error handling. For example:
if (result.Collaborators == null)
{
string errorMessage = "Failed to add new collaborator";
}
Hi,
Hi,
But this presenter role is the main reason we use GroupDocs! Please provide another solution.
Hi,
Hi,
Hi all,
Hello Jeroen,
Hi,
Yes, Pavel.
Hello,
Hi again,