Monday, May 7, 2012

Item-Level Permission for a SharePoint Document Library

The SharePoint Document Library doesn't have the option in his UI-Settings to change the item-level permisssions like normal SharePoint lists.

This means that you can't create a document library in which only user who created the documents can only see their documents and no one else.

You can simulate the behaviour by changing the permissions on each single document but this could be expensive and could also cause performance issues on  large libraries.

The better option is the activate the item level security by PowerShell. It seems that Microsoft  only disabled the UI Option but with PowerShell you can reactivate it. I don't know why Microsoft disabled this option but in my tests this method worked very well.

 $web = Get-SPWeb http://YourSite/  
 $list = $web.Lists["Your Document Library Name"]  
 $list.ReadSecurity = 2  

What the values for ReadSecurity property means can be seen here.

There is also a property for the writesecurity, that you can use to enable users to edit only their own items.


No comments: