SPList.WriteSecurity Property
Gets or sets the Write security setting for the list.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Property Value
Type: System.Int32A 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.
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
- 2/8/2012
- AsrarG
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
- 2/9/2010
- Yaroslav Pentsarskyy