You are not authorized to 'Modify library and manage documents' ('Document').
Hi, public void UploadDocumentFluent(Guid parentID, string documentName, string description, string path)
I know I need to set the Provider for my document library to SuppressSecurityChecks to false.
I'm not sure how to do that -
Here is some code that I found in the documentation to upload a document into a library, however when I do so I get a 'Not authorized' error
How do I access the provider for a document library?
Thanks!
Ron
//get a document file from file system
System.IO.
FileInfo docFile = new System.IO.FileInfo(path);
App.WorkWith()
.DocumentLibrary(parentID)
.CreateDocument()
.Do(d =>
d.Title = documentName;
d.Description = description;
)
.CheckOut()
.UploadContent(docFile.OpenRead(), docFile.Extension)
.CheckInAndPublish()
.SaveChanges();
I figured it out - App
.WorkWith().DocumentLibrary(parentID).GetManager().Provider.SuppressSecurityChecks = true;
Hello Ron,
Another option is using a user with proper permissions. SuppressSecurityChecks is suggested only for particular cases, since it grants full access over the objects.
All the best,
Ivan Dimitrov
the Telerik team