I'm adding items to my list by powershell script. I need to fine-grain user permissions to added items.
Code I'm using now:
$claim = New-SPClaimsPrincipal -ClaimValue $role -ClaimType $ROLE_CLAIM -TrustedIdentityTokenIssuer $sts
[Microsoft.SharePoint.SPRoleAssignment] $roleAssignment = New-Object Microsoft.SharePoint.SPRoleAssignment($claim.ToEncodedString(), "", $role, "")
$roleAssignment.RoleDefinitionBindings.Add($web.RoleDefinitions[$permissionLevel[$permission]])
$item.BreakRoleInheritance($true)
$item.RoleAssignments.Add($roleAssignment)
$item.Update()
This works when I'm assigning Full Control to administrators. But I'd like also other users to be able to read all items from the list. So I thought I'll add "All Authenticated Users" (like in people picker) read permission. The thing is that I don't what ClaimValue
and ClaimType
I have to pass to New-SPClaimsPrincipal
cmdlet. Any ideas?