new AuthorizationContext(action[, targetName], brokenRules)

Creates a new authorization context object.

Warning: Authorization context objects are created in models internally. They are intended only to make publicly available the context for custom authorization rules.

Parameters

Name Type Optional Description

action

bo.rules.AuthorizationAction

 

The operation to authorize.

targetName

string

Yes

Eventual parameter of the authorization action.

brokenRules

bo.rules.BrokenRuleList

 

The list of the broken rules.

Throws

Argument error: The action must be an AuthorizationAction item.

Argument error: The target name must be a string value.

Argument error: The broken rules must be a BrokenRuleList object.

Properties

read-only
brokenRules  bo.rules.BrokenRuleList

The list of the broken rules.

read-only
locale  string

The current locale.

read-only
ruleId  string

The identifier of the authorization action. Generally it is the action value, or when target is not empty, the action value and the target name separated by a dot, respectively.

read-only
user  bo.system.UserInfo

The current user.