SharePoint Permission

Hello! I have SharePoint 2013 on Windows Server 2008 R2. I use Visual Studio 2013 to connect  by SharePoint Object Model for work with SharePoint web servises. Can you, please, tell me "How can I configure the permission to allow some of the windows users to be able to upload/delete/read/write/download or deny access to file or folder in Document Library in current site?" Is this possible? Please, if is possible provide with code on c#.


February 9th, 2015 5:04am

Hi,

1- you will create a windows application to use object model.

2-using you code you will authenticate the users to access the site

3-on the site you will provide access to the users who need to run the application and do those operations

the code:

 using (srcContext = new ClientContext(txtUrlFrom.Text))
                {

                    NetworkCredential credentials = new NetworkCredential(txtUserNameFrom.Text, txtPasswordFrom.Text);
                }

//start doing your operations as sample
 Web srcWeb = srcContext.Web;
            List srcList = srcWeb.Lists.GetByTitle(srcLibrary);
            ListItemCollection col = srcList.GetItems(new CamlQuery());
            srcContext.Load(srcList.RootFolder);
            srcContext.Load(srcList.RootFolder.Folders);

            srcContext.Load(col);
            srcContext.ExecuteQuery();

Links to object model

https://msdn.microsoft.com/en-us/library/office/fp179912.aspx

to set the permissions on the site

http://support.sherweb.com/Faqs/Show/how-to-manage-permissions-in-sharepoint-2013

Free Windows Admin Tool Kit Click here and download it now
February 9th, 2015 6:11am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics