Property

new RuleManager()

Creates a new rule manager object.

Property

noAccessBehavior  bo.rules.NoAccessBehavior

Defines the default behavior for unauthorized operations.

Default value

Methods

add(rule)

Adds a new rule to the business object model.

Parameter

Name Type Optional Description

rule

(bo.rules.ValidationRule or bo.rules.AuthorizationRule)

 

The rule to add.

Throws

Argument error: The rule must be a Rule object.

Argument error: The rule is not initialized.

hasPermission(context)

Validates a property - executes all validation rules of the property.

Parameter

Name Type Optional Description

context

bo.rules.AuthorizationContext

 

The context of the action authorization.

Throws

Argument error: The context must be a AuthorizationContext object.

Authorization error: The user has no permission to execute the action.

initialize(defaultBehavior)

Initializes the rule manager: sorts the rules by priority and sets the default behavior for unauthorized operations.

Parameter

Name Type Optional Description

defaultBehavior

bo.rules.NoAccessBehavior

 

The default behavior for unauthorized operations.

Throws

Argument error: The severity must be a NoAccessBehavior item.

validate(property, context)

Validates a property - executes all validation rules of the property.

Parameters

Name Type Optional Description

property

bo.shared.PropertyInfo

 

The model property to validate.

context

bo.rules.ValidationContext

 

The context of the property validation.

Throws

Argument error: The property must be a PropertyInfo object.

Argument error: The context must be a ValidationContext object.