Purpose
Extends:
Definition of Purpose class.
Purpose is a connection between Sandbox and Perimeter. Whenever a Perimeter is added to a Sandbox new Purpose is created. And all exposed methods from Perimeter and copied to Purpose. Purpose should have as less methods as possible. Purpose is used internally by Sandbox and shouldn't be used as standalone object.
Constructor Summary
Public Constructor | ||
public |
constructor(name: *, sandbox: *) Create new instance of purpose. |
Method Summary
Public Methods | ||
public |
isAllowed(args: ...*): * Return true if perimeter is allowed to perform an action. |
|
public |
isNotAllowed(args: ...*): * Return true if perimeter is not allowed to perform an action. |
Inherited Summary
From class PubSub | ||
public |
trigger(name: *, args: ...*): * Trigger all events synchronously by default |
|
public |
triggerAsync(args: ...*): * Trigger asynchronously |
Public Constructors
public constructor(name: *, sandbox: *) source
Create new instance of purpose.
Params:
Name | Type | Attribute | Description |
name | * | ||
sandbox | * |
Public Methods
public isAllowed(args: ...*): * source
Return true if perimeter is allowed to perform an action. It uses the governess of the perimeter.
Params:
Name | Type | Attribute | Description |
args | ...* |
Return:
* |
public isNotAllowed(args: ...*): * source
Return true if perimeter is not allowed to perform an action. It uses the governess of the perimeter.
Params:
Name | Type | Attribute | Description |
args | ...* |
Return:
* |