IAdmMemberAttrOperatorValueCondition

The IAdmMemberAttrOperatorValueCondition interface represents the If <property of the member> <relation> <value> condition, which is available in business rules before/after adding/removing a member from a group.

Inheritance: IAdmAttrOperatorValueCondition

Properties

  • Property

  • Description

  • AttributeName

  • Gets or sets the name of the property whose value to compare.

  • ComparisonOperator

  • Gets or sets a comparison operator for the condition.

  • Value

  • Gets or sets a value to compare with the actual property value.

  • CaseSensitive

  • Gets or sets a value indicating whether the property value will be treated as case sensitive when checking the condition.

  • ObjectType

  • Gets or sets the type of objects the condition applies to.

Details

AttributeName

Gets or sets the name of the property whose value to compare.

  • Type:
  • string
  • Access:
  • Read/Write

ComparisonOperator

Gets or sets a comparison operator for the condition.


Value

Gets or sets a value to compare with the actual property value.

Examples

The following code sample creates a condition that returns true if the Department of the new group member is HR.

PowerShell
# The $actionSet variable refers to an action set in a
# before/after adding/removing a member from a group business rule.

# Create condition.
$condition = $actionSet.Conditions.CreateEx("adm-MemberAttributeOperatorValueCondition")
$departmentCondition = $condition.GetCondition()

$departmentCondition.AttributeName = "department"
$departmentCondition.ComparisonOperator = "ADM_COMPARISONOPERATOR_EQUAL"
$departmentValue = New-Object "Softerra.Adaxes.Adsi.AdsPropertyValue"
$departmentValue.PutObjectProperty("ADSTYPE_UNKNOWN", "HR")
$departmentCondition.Value = $departmentValue
$departmentCondition.CaseSensitive = $false

# Save changes.
$condition.SetCondition($departmentCondition)
$condition.SetInfo()
$actionSet.Conditions.Add($condition)
C#
// The actionSet variable refers to an action set in a
// before/after adding/removing a member from a group business rule.

// Create condition.
IAdmBusinessRuleCondition condition = (IAdmBusinessRuleCondition)actionSet.Conditions.CreateEx(
    "adm-MemberAttributeOperatorValueCondition");
IAdmMemberAttrOperatorValueCondition departmentCondition = 
    (IAdmMemberAttrOperatorValueCondition)condition.GetCondition();

departmentCondition.AttributeName = "department";
departmentCondition.ComparisonOperator = ADM_COMPARISONOPERATOR_ENUM.ADM_COMPARISONOPERATOR_EQUAL;
AdsPropertyValue departmentValue = new AdsPropertyValue();
departmentValue.PutObjectProperty(ADSTYPEENUM.ADSTYPE_UNKNOWN, "HR");
departmentCondition.Value = departmentValue;
departmentCondition.CaseSensitive = false;

// Save changes.
condition.SetCondition(departmentCondition);
condition.SetInfo();
actionSet.Conditions.Add(condition);

CaseSensitive

Gets or sets a value indicating whether the property value will be treated as case sensitive when checking the condition.

  • Type:
  • bool
  • Access:
  • Read/Write

ObjectType

Gets or sets the type of objects the condition applies to.

  • Type:
  • string
  • Access:
  • Read/Write

Requirements

Minimum required version: 2023

See also