Ramon Torras

TECHNOLOGY ENTHUSIAST

How to restrict editing in SP List only to own Items?

In this case what we want is allow to the user create and edit his own items but doesn’t touch the others. Even they can’t see the others elements.

You can define this in the list configuration.

Using User Interface

In the advanced settings of the list we can find this section:

 

 

Programmatically using PowerShell

(ex. List in the root site)

 

 

Programmatically using SSOM (Server-side Object Model )

 

 

Programmatically CSOM (Client-side Object Model)

 

(2015.05.07) it’s not available.

àI will write a post soon with a workaround with Roles and breaking the inheritance.

Programmatically JSOM (Javascript Side Object Model)

 

(2015.05.07) it’s not available.

à I will write a post soon with a workaround with Roles and breaking the inheritance.

 

Declarative way: Provisioning the list

There is another way. You can provision the list with the proper settings with a List template.

The Elements.xml contains general information about the List Definition like the Name, Description, Quick Launch, etc. Schema.xml, as the name implies, contains the actual metadata information about the List Definition. Among them, there is the SecurityBits node.

 

 

The SecurityBits attribute specifies permissions for a list, where the first bit represents Read access and the second bit represents Write access. The bit for Read access contains one of two possible values: 1 allows all users Read access to all items, and 2 allows users Read access only to items they create. The bit for Write access contains one of three possible values: 1 allows all users to modify all items, 2 allows users to modify only items they create, and 4 prevents users from modifying the list. This example sets the security bits to 12, which prevents users from modifying the items of other users.

 

References

https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.writesecurity.aspx

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

https://social.msdn.microsoft.com/Forums/en-US/f7d3c3fd-1386-4239-99ad-2b3d23babb0e/how-to-set-read-write-security-on-list-using-client-object-model?forum=sharepointdevelopmentprevious

 

Creating a List Definition -> List Template

https://msdn.microsoft.com/en-us/library/dd587243(v=office.11).aspx

 

 

  • Matteo Zanardini

    That’s what i was looking for!
    Thanks

  • Bruce Albany

    FYI – CSOM now supports ReadSecurity and WriteSecurity properties (hoorah!)