IAdmTrusteeRoleCondition
The IAdmTrusteeRoleCondition interface represents the If the initiator is assigned to <security role> condition.
Inheritance: IAdmCondition
Properties
-
Property
-
Description
-
IsOperator
-
Gets or sets a value indicating whether the operation initiator should or should not be assigned to the specified security role to meet the condition.
-
Role
-
Gets or sets the security role that the operation initiator should or should not be assigned to in order to meet the condition.
Details
IsOperator
Gets or sets a value indicating whether the operation initiator should or should not be assigned to the specified security role to meet the condition.
- Type:
- ADM_ISOPERATOR_ENUM
- Access:
- Read/Write
Role
Gets or sets the security role that the operation initiator should or should not be assigned to in order to meet the condition.
- Type:
- IAdmRole
- Access:
- Read/Write
Examples
The following code sample creates a condition that returns true if the initiator is assigned to the AdaxesAdmins security role.
- PowerShell
-
# The $actionSet variable refers to an action set in a # business rule, custom command, or scheduled task. # Create condition. $condition = $actionSet.Conditions.CreateEx("adm-TrusteeRoleCondition") $roleCondition = $condition.GetCondition() $roleCondition.IsOperator = "ADM_ISOPERATOR_IS" # Bind to the security role. $containerPath = $service.Backend.GetConfigurationContainerPath("SecurityRoles") $pathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath" $containerPath $rolePath = $pathObj.CreateChildPath("CN=AdaxesAdmins") $role = $service.OpenObject($rolePath.ToString(), $null, $null, 0) $roleCondition.Role = $role # Save changes. $condition.SetCondition($roleCondition) $condition.SetInfo() $actionSet.Conditions.Add($condition) - C#
-
// The actionSet variable refers to an action set in a // business rule, custom command, or scheduled task. // Create condition. IAdmBusinessRuleCondition condition = (IAdmBusinessRuleCondition)actionSet.Conditions.CreateEx( "adm-TrusteeRoleCondition"); IAdmTrusteeRoleCondition roleCondition = (IAdmTrusteeRoleCondition)condition.GetCondition(); roleCondition.IsOperator = ADM_ISOPERATOR_ENUM.ADM_ISOPERATOR_IS; // Bind to the security role. string containerPath = service.Backend.GetConfigurationContainerPath("SecurityRoles"); AdsPath pathObj = new AdsPath(containerPath); AdsPath rolePath = pathObj.CreateChildPath("CN=AdaxesAdmins"); IAdmRole role = (IAdmRole)service.OpenObject(rolePath.ToString(), null, null, 0); roleCondition.Role = role; // Save changes. condition.SetCondition(roleCondition); condition.SetInfo(); actionSet.Conditions.Add(condition);
Requirements
Minimum required version: 2009.1