Item-level permissions on document libraries.
I recently had a client requirement where the client wanted to created a “drop box” type of document library, where users were able to modify and view only there own documents. I knew this possible in custom lists through this option being displayed in List Setting / Advanced Settings link.
What I didn’t realise was that this option wasn’t displayed in document libraries. I found this post from Matt Morse that had the solution to this problem. Matt points out that when you take a look in the Microsoft.SharePoint.ApplicationPages.dll the following code exists in the AdvancedSettingsPage class’s OnLoadEvent.
Matt has written a great little tool here, and the source is available here. The code is pretty straight forward as you can see from the snippet below.
The property that we are setting in this case is ReadSecurity and WrtieSecurity the possible values are documented in these MSDN pages. In my case I was setting “Users have read access only to items that they create (2)” and “Users can modify only items that they create (2)”. Using Matt’s tool I basically just entered the following from the command line.
SPSetListProperty “http://server” "/Site" "Document Lib" "ReadSecurity" "2"
SPSetListProperty “http://server” "/Site" "Document Lib" "WriteSecurity" "2"
Once this was done the document library performed exactly how we required, now the users who have contribute permissions can use this library to view and edit only their own items, and owners are able to see all items in the document library.
I found your blog when searching for some sort of dropbox functionality for a document library. You posted exactly what i was searching for. I did however found the post from Matt Morse too, and maybe you should copy the security note to your post that he added at 5/4/2007.
When users open the explorer view of a document library that has been configured with SPSetListProperty.exe, they can still see all other user’s documents. The change that is made only effects the GUI.