I am working on SPE code to set user permissions for a specific tree item.
$role = "Michael"
$path = "master:\content\home\distributors\a-b\Austria"
$acl1 = New-ItemAcl -AccessRight item:read -PropagationType Any -SecurityPermission AllowAccess -Identity $role
$acl2 = New-ItemAcl -AccessRight item:write -PropagationType Any -SecurityPermission AllowAccess -Identity $role
$acl3 = New-ItemAcl -AccessRight item:rename -PropagationType Descendants -SecurityPermission AllowAccess -Identity $role
$acl3a = New-ItemAcl -AccessRight item:rename -PropagationType Entity -SecurityPermission DenyAccess -Identity $role
$acl4 = New-ItemAcl -AccessRight item:create -PropagationType Any -SecurityPermission AllowAccess -Identity $role
$acl5 = New-ItemAcl -AccessRight item:delete -PropagationType Descendants -SecurityPermission AllowAccess -Identity $role
$acl5a = New-ItemAcl -AccessRight item:delete -PropagationType Entity -SecurityPermission DenyAccess -Identity $role
$acl6 = New-ItemAcl -AccessRight item:read -PropagationType Descendants -SecurityPermission AllowInheritance -Identity $role
Get-Item -Path $path | Add-ItemAcl -AccessRules $acl1, $acl2, $acl3, $acl3a, $acl4, $acl5, $acl5a, $acl6 -PassThru
This is working to set the item and descendants for read, write, rename, create, and delete. I can't figure out how to also set the inheritance option for item and descendants though.
It doesn't seem I can do item:inheritance
under -AccessRight
.
When I try doing: New-ItemAcl -AccessRight item:read -PropagationType Descendants -SecurityPermission AllowInheritance -Identity $role
it doesn't do anything.
Any thoughts on this?