Redaction tool - This reviewer does not have enough permissions

I’m getting this message when I try to use the text or resource redaction tools:


This reviewer does not have enough permissions to perform the operation.

This is only happening in a demo project. These tools work correctly in another project and I can’t figure out the difference.

Here is my controller code:

public ActionResult WithHtmlHelper()
{
var svc = ObjectFactory.GetInstance();
svc.AddCollaborator(“Quick_Start_Guide_To_Using_GroupDocs.pdf”, "groupdocs@groupdocs.com", “User”, “1”, null);

return View();
}

Here is my cshtml page:

@using Groupdocs.Web.Annotation
@using Groupdocs.Web.Annotation.Mvc

@(Html.Groupdocs()
.Annotation()
.AccessRights(Groupdocs.Common.AnnotationReviewerRights.All)
.AreaToolOptions(new DrawingOptions { PenWidth = 1, DashStyle = Groupdocs.Common.DashStyle.Solid, PenColor = 0xFF0000 })
.ArrowToolOptions(new DrawingOptions { PenWidth = 1, DashStyle = Groupdocs.Common.DashStyle.Solid, PenColor = 0xFF0000 })
.ClickableAnnotations(true)
.ConnectorPos(ConnectorPosition.Bottom)
.DisconnectUncommented(true)
.ElementId(“annotation-widget”)
.EnableRightClickMenu(true)
.FilePath(“Quick_Start_Guide_To_Using_GroupDocs.pdf”)
.HighlightColor(0xFFFF00)
.MinimumImageWidth(2560)
.OpenThumbnails(false)
.PolylineToolOptions(new DrawingOptions { PenWidth = 1, DashStyle = Groupdocs.Common.DashStyle.Dash, PenColor = 0xFF0000 })
.PreloadPageCount(3)
.Quality(90)
.SaveReplyOnFocusLoss(true)
.ScrollOnFocus(true)
.ShowFileExplorer(false)
.ShowHeader(true)
.ShowPaging(true)
.ShowPrint(false)
.ShowThumbnails(true)
.ShowToolbar(true)
.ShowZoom(true)
.StrikeoutMode(Groupdocs.Common.StrikeoutToolMode.Remove)
.TextFieldBackgroundColor(0xf0f0f0)
.Tools(AnnotationTools.All))


Here is the generated java script:

$(function () {
var annotationWidget = $(’#annotation-widget’).groupdocsAnnotation({
width: 0,
height: 0,
fileId: ‘Quick_Start_Guide_To_Using_GroupDocs.pdf’,
docViewerId: ‘annotation-widget-doc-viewer’,
quality: 90,
enableRightClickMenu: true,
showHeader: true,
showZoom: true,
showPaging: true,
showPrint: false,
showFileExplorer: false,
showThumbnails: true,
showToolbar: true,
openThumbnails: false,
zoomToFitWidth: false,
zoomToFitHeight: false,
initialZoom: 100,
preloadPagesCount: 3,
enableSidePanel: true,
scrollOnFocus: true,
strikeOutColor: ‘’,
highlightColor: ‘#ffff00’,
textFieldBackgroundColor: ‘#f0f0f0’,
enabledTools: 8191,
connectorPosition: 1,
saveReplyOnFocusLoss: true,
clickableAnnotations: true,
disconnectUncommented: true,
enableStandardErrorHandling: true,
strikeoutMode: 1,
undoEnabled: true,
minimumImageWidth: 2560,
areaToolOptions: { pen: { width: 1, color: 16711680, dashStyle: 0 }, brush: { color: null } },
polylineToolOptions: { pen: { width: 1, color: 16711680, dashStyle: 1 }, brush: { color: null } },
arrowToolOptions: { pen: { width: 1, color: 16711680, dashStyle: 0 }, brush: { color: null } },
sideboarContainerSelector: ‘div.comments_sidebar_wrapper’,
usePageNumberInUrlHash: false,
textSelectionSynchronousCalculation: true,
variableHeightPageSupport: true,
useJavaScriptDocumentDescription: true,
isRightPanelEnabled: true,
createMarkup: true,
use_pdf: ‘true’,
_mode: ‘annotatedDocument’,
selectionContainerSelector: “[name=‘selection-content’]”,

graphicsContainerSelector: ‘.annotationsContainer’,

userName: ‘groupdocs@groupdocs.com’, userId: ‘3f8b6a5375337dae’

});
});

Hello Jason,

We are sorry to hear that you have such issue. The problem that you have described is not because your source code that you have provided is incorrect. The problem lies in the database and is associated with the user with login “groupdocs@groupdocs.com” and his insufficient permissions.

For every user there is a permission entity which is stored in the database, in the table “AnnotationCollaborators”, column “AccessRights”. Permission entity itself is a number which is presented as enumeration “Groupdocs.Common.AnnotationReviewerRights” in the GroupDocs.Annotation library. Here it is:
None = 0,
CanView = 1,
CanAnnotate = 2,
CanDownload = 4,
CanExport = 8,
CanDelete = 16,
CanRedact = 32,
All = 63


I suppose that you obtain a something like in the screenshot below. In such case go to the database which GroupDocs.Annotation uses, find user “groupdocs@groupdocs.com” in the table “Users”, then find its “AccessRights” from table “AnnotationCollaborators” and change it respectively to the list above.

Or you can use the next T-SQL script.

How to find out which permissions user has:

SELECT [AnnotationCollaborators].AccessRights FROM [AnnotationCollaborators] INNER JOIN [Users] ON [Users].Id = [AnnotationCollaborators].[UserId] WHERE [Users].[UserName] = ‘groupdocs@groupdocs.com’;

How to change his permissions to another:

UPDATE AnnotationCollaborators SET AccessRights = 63 WHERE [AnnotationCollaborators].[UserId] IN (SELECT Id FROM Users WHERE UserName = ‘groupdocs@groupdocs.com’);


If you will have more questions please feel free to contact us.

Thank you Denis. This worked.