class staticbo.rules. AuthorizationContext
Source: rules/
Provides the context for custom authorization rules.
Properties
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 |
|
The operation to authorize. |
|
targetName |
string |
Yes |
Eventual parameter of the authorization action. |
brokenRules |
|
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-onlybrokenRules
bo.rules.BrokenRuleList
The list of the broken rules.
read-onlylocale
string
The current locale.
read-onlyruleId
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-onlyuser
bo.system.UserInfo
The current user.