本文主要是介绍Changing the Item-Level Permissions Settings for a Document Library requires PowerShell,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
As it turns out the, setting Item-Level Permissions in a library is fully supported with PowerShell!
The PowerShell commands for changing this are very simple:
$web = Get-SPWeb http://YourSite/
$list = $web.Lists[“Your Document Library Name”]
$list.ReadSecurity = 2
$list.Update()
$web.Dispose()
Note the 3rd line which is where you determine the value for this setting using the following values:
1 = “Read all items”
2 = “Read items that were created by the user”
If you wish to modify the values for Create and Edit access instead, replace .ReadSecurity with .WriteSecurity with the following values:
1 = “Create and edit All items”
2 = “Create items and edit items that were created by the user”
4 = “None”
For example:
$web = Get-SPWeb http://YourSite/
$list = $web.Lists[“Your Document Library Name”]
$list.WriteSecurity = 2
$list.Update()
$web.Dispose()
这篇关于Changing the Item-Level Permissions Settings for a Document Library requires PowerShell的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!