Edit only owned list items in Windows Sharepoint Services 3.0

dirq picture dirq · Apr 9, 2009 · Viewed 29.9k times · Source

Is there a way to limit the "edit item" permission in WSS 3.0 to only allow a user to edit his own documents or list items? We need the ability for a user to edit only documents/list items he creates - NOT items that someone else created. So, essentially we need a sub-set of the EDIT permission as well as ADD.

Is this possible in Windows Sharepoint Services 3.0? Is there a way to create custom permissions in code or a feature?

Answer

Abs picture Abs · May 7, 2009

WSS has a basic UI for setting item-level permission on list items, but they hide that from the UI for document libraries. If you go into Settings->List Settings->Avanced settings for a list, you'll see the options to do pretty much what you're asking for. However, on document libraries, that UI is not available. The settings it drives, though are avaiable via the object model.

You could set those same properties for a document library like this:

SPDocumentLibrary onlyOwnLib = theWeb.Lists["DocLibName"]  
onlyOwnLib.WriteSecurity = 2;  
onlyOwnLib.Update();  

And that should about do it. However, apparently that doesn't really set permissions; it just controls what the user can do via the UI. If they had another interface to the library (like via WebDAV) or list (like via the web services), it wouldn't prevent them from editing items they didn't create. If you want true item-level permissions, I think you need to go the event handler route.

This post from Matt Morse explains it in more detail, and he even wrote a command line tool to set the property (plus the .ReadSecurity property) for lists and libraries.