I need to update some properties of a document directly from code. I try, for example, to update the property ViewsCounter. This is the code:
var linkButton = sender
text = ((System.Web.UI.WebControls.LinkButton)(sender)).Text;
LibrariesManager libManager = LibrariesManager.GetManager();
IQueryable<Document> documents = libManager.GetDocuments().Where(o1 => o1.ApprovalWorkflowState ==
Document doc = documents.Where(o1 => o1.Title == text).FirstOrDefault();
But when i run the program, it return me this Error:
"You are not authorized to 'Modify library and manage documents' ('Document')."
Why? Is there any mistakes in the code?
when the code executes in a custom user control, the permission of the user (in other words the current user that's in sitefinity) is the one of the user or can I force to execute it as an Admin?