Class: RuleManager

bo.rules. RuleManager

Provides methods to manage the rules of a business object model.

new RuleManager()

Creates a new rule manager object.

Members

noAccessBehavior :bo.rules.NoAccessBehavior

Defines the default behavior for unauthorized operations.

Type:
Default Value:
  • {bo.rules.NoAccessBehavior#throwError}

Methods

add(rule)

Adds a new rule to the business object model.

Parameters:
Name Type Description
rule bo.rules.ValidationRule | bo.rules.AuthorizationRule

The rule to add.

Throws:

hasPermission(context)

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

Parameters:
Name Type Description
context bo.rules.AuthorizationContext

The context of the action authorization.

Throws:

initialize(defaultBehavior)

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

Parameters:
Name Type 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 Description
property bo.shared.PropertyInfo

The model property to validate.

context bo.rules.ValidationContext

The context of the property validation.

Throws:
If you find bugs or have feature requests, please let us know.

JavaScript business objects ♦ Copyright © 2014-2016 Logikum, Ltd.
Documentation generated by JSDoc 3.2.2 on 2015. December 31. using the DocStrap template.