import StrictGoverness from 'kindergarten/src/kindergarten/governesses/StrictGoverness.js'
StrictGoverness
Extends:
A very strict governess! She forces all exposed methods from the sandbox or
perimeter to be governed. This means that all exposed methods must call
guard()
method.
Use this governess if you, or you colleagues forget to call guard()
method
in you exposed methods.
Note: Strict Governess does not prevent the exposed method to be executed!
Actually it executes that method and throw an error if that method did not
called the guard()
Constructor Summary
Public Constructor | ||
public |
constructor(args: ...*) |
Inherited Summary
From class PubSub | ||
public |
trigger(name: *, args: ...*): * Trigger all events synchronously by default |
|
public |
triggerAsync(args: ...*): * Trigger asynchronously |
From class HeadGoverness | ||
public get |
unguarded: * The getter of unguarded property. |
|
public set |
unguarded: * The setter of unguarded property. |
|
public |
rules: * |
|
public |
addRule(rules: ...*): * |
|
public |
doUnguarded(callback: *, context: *): * Perform some stuff unguarded |
|
public |
getRules(type: *): * |
|
public |
governed(callback: *, args: *[], callingContext: *): * Watch over some child action. |
|
public |
guard(action: *, args: ...*): * Throws an error if child is not allowed to do some action |
|
public |
hasAnyRules(): * The governess is empty when no rules have been defined |
|
public |
Returns true if child is allowed to perform some action |
|
public |
isGuarded(): * |
|
public |
isNotAllowed(args: ...*): * Returns false if child is allowed to perform some action |
|
public |
isUnguarded(): * |
|
public |
learnRules(perimeter: *): * |
Public Constructors
public constructor(args: ...*) source
Override:
HeadGoverness#constructorParams:
Name | Type | Attribute | Description |
args | ...* |
Public Methods
public governed(args: ...*): * source
Override:
HeadGoverness#governedParams:
Name | Type | Attribute | Description |
args | ...* |
Return:
* |
public guard(args: ...*): * source
Override:
HeadGoverness#guardParams:
Name | Type | Attribute | Description |
args | ...* |
Return:
* |