I am trying to rename some of the roles with sample, to get rid of the sample part and later i want to customize the priviliges.
I look on the SDK at UpdateAuthorizationRole, but i doesn't work as i expected.
Who has an clue?
Below is the snipppet i am trying to get working:
$authMgr = Get-View AuthorizationManager
$rootid = Get-Folder -norecursion | Get-View
$ARR_ROLES = $authMgr.RoleList
foreach ($role in $ARR_ROLES)
{
if ($role.info.label -match "(sample)")
{
$ROLEID = $role.id
$OLD_LABEL = $role.info.label
$NEW_LABEL = $OLD.Replace("(sample)", "")
$authMgr.UpdateAuthorizationRole($oordid.moref, $ROLEID, $NEW_LABEL)
}
}