You are not authorized to 'Modify library and manage doc

Posted by Community Admin on 05-Aug-2018 12:57

You are not authorized to 'Modify library and manage documents' ('Document').

All Replies

Posted by Community Admin on 13-May-2011 00:00

Hi,

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



 

 

public void UploadDocumentFluent(Guid parentID, string documentName, string description, string path)

 

 

 

 

 

//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();

 

Posted by Community Admin on 13-May-2011 00:00

I figured it out -

App

 

 

.WorkWith().DocumentLibrary(parentID).GetManager().Provider.SuppressSecurityChecks = true;

 


before trying to upload the doc

thnx

Ron

Posted by Community Admin on 16-May-2011 00:00

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

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

This thread is closed