1 out of 1 rated this helpful - Rate this topic

SPList.WriteSecurity Property

Gets or sets the Write security setting for the list.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
public int WriteSecurity { get; set; }

Property Value

Type: System.Int32
A 32-bit integer that specifies the Write security setting. Possible values include the following:
  • 1 — All users can modify all items.

  • 2 — Users can modify only items that they create.

  • 4 — Users cannot modify any list item.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
IssueTracking
Does it work with Issue Tracking Lists? $0I've tried it and it's not working. The user can edit others items.$0 $0Is there a solution for this?$0
Can be overwritten programatically
Event if you have a list with WriteSecurity set to 2, you can still perform edit and save operations that run under SPSecurity.RunWithElevatedPrivileges.

The key here is to make sure your list item has been instantiated from a List not using SPContext.Current.Web but rather clean SPWeb object.

This is because SPContext carries the context of a user before the elevation and hence regular-users security will be applied and save operation aborted.

Yaroslav Pentsarskyy
http://www.sharemuch.com