User roles

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Annotation MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-annotation -- dnx GroupDocs.Annotation.Mcp --yes
Folders, licensing and more →

GroupDocs.Annotation v22.11 and later allows you to specify a user role for each user.

You can specify a User object for any reply. This object represents the author of the reply. You can also set a role of the user:

  • Viewer - GroupDocs.Annotation does not add their replies to the document.
  • Editor - GroupDocs.Annotation adds their replies. Use this feature to control if a user can or cannot add comments to the document.

The following code snippet shows how to add a user role:


using (Annotator annotator = new Annotator("input.pdf-file"))
{
  AreaAnnotation area = new AreaAnnotation
  {
    BackgroundColor = 65535,
    Box = new Rectangle(100, 100, 100, 100),
    CreatedOn = DateTime.Now,
    Message = "This is area annotation",
    Opacity = 0.7,
    PageNumber = 0,
    Replies = new List<Reply>
    {
        new Reply 
        {
            Comment = "This comment will be applied",
            RepliedOn = DateTime.Now,
            User = new User(1, "Reviewer", Role.Editor)
        },
        new Reply
        {
            Comment = "This comment will NOT be applied",
            RepliedOn = DateTime.Now,
            User = new User(1, "Member", Role.Viewer)
        }
    }
  };

  annotator.Add(area);
  annotator.Save("result_export");
}