1

I have started development in Visual Studio.

I need help on how to programatically set Advanced permissions for a SharePoint list, specifically the "Create items and edit items that were created by the user​​​" setting

1 Answer 1

1

Try it as below:

var customList = web.GetListByTitle("Documenten");

// Change the advanced settings
//1— All users have Read access to all items.
//2— Users have Read access only to items that they create.

customList.ReadSecurity = 2;

//1— Write all items.
//2— Write only my items.
//4— Write no items (read-only list).

customList.WriteSecurity = 2;

customList.Update()
context.Load(customList);
context.ExecuteQuery();

Ensure that you have the latest version of CSOM or atleast August 2016 CSOM dll.

SharePoint CSOM version released for SharePoint Online - August 2016

3
  • Im developing sharepoint online add-ins especially lists for now and could u help me with? Is this solution for sharepoint online? Where i need put this code provided by you? Thanks
    – Lubirpg
    Commented Jan 19, 2017 at 10:10
  • Yes its a solution for SharePoint online. How are you provisioning lists ? Are you using CSOM/JSOM/REST api ? Commented Jan 19, 2017 at 10:12
  • Hi thanks for fast response. Im using CSOM. I wrote this code to Remote Event Receiver, into function public SPRemoteEventResult ProcessEvent, Is it right? Compilation is okay, but doesnt work.
    – Lubirpg
    Commented Jan 20, 2017 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.