FieldMapperDelegate
FieldMapperDelegates provide the API for orchaestrating and arranging FieldMappers on a Transformer. They should typically be used through the util module
Constructor Summary
Public Constructor | ||
public |
constructor(sourceKey: string, permissionRanking: Array<string>) |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
delegate: {} |
|
public |
|
|
public |
|
|
public |
restrict: * |
|
public |
|
|
public |
sourceKey: * |
Private Members | ||
private |
|
Method Summary
Public Methods | ||
public |
always(): * Indicate the following action should be used for every permission level |
|
public |
asList(): * Set the isList falg to be passed to the FieldMapper ie. |
|
public |
Indicate the following action should be used for this permission level and above |
|
public |
Build the permission API for the provided permission ranking on the FieldMapperDelegate instance |
|
public |
Assign a CustomFieldMapper to the current permission masking |
|
public |
passthrough(): * Assigns a PassthroughFieldMapper to the current permission masking |
|
public |
restrictTo(permission: string): * Indicate the following action should be used for this permission level and all others are set to null |
|
public |
|
|
public |
subTransform(transformerKey: string | Transformer | function(): any, permissionLvl: string): * Assign a SubtransformFieldMapper, indicated by @param transformerKey to the current permission masking. |
|
public |
Perform the field transformation at the provided permission level |
|
public |
Indicate the following action should be used for the indicated permission level |
Private Methods | ||
private |
_always() Set all permission lvls to use the same field mapper if the always flag is set |
|
private |
_checkAndReset(fieldMapper: *) Restrict transforming if needed. |
|
private |
_restrictAtOrAbove(fieldMapper: FieldMapper) Restrict access all fields except specified permission lvl and above |
|
private |
_restrictTo(fieldMapper: FieldMapper) Restrict access all fields except specified permission lvl |
Public Constructors
Public Members
public [`${atOrAbove}${capitalize(permission)}`]: * source
public [`${restrictTo}${capitalize(permission)}`]: * source
public [`${when}${capitalize(permission)}`]: * source
public curPermissionLvl: * source
public delegate: {} source
public permissionRanking: * source
public restrict: * source
public restrictAtOrAbove: * source
public sourceKey: * source
Private Members
Public Methods
public always(): * source
Indicate the following action should be used for every permission level
Return:
* |
public asList(): * source
Set the isList falg to be passed to the FieldMapper ie. 1:M or M:M associations
Return:
* |
public atOrAbove(permission: string): * source
Indicate the following action should be used for this permission level and above
Params:
Name | Type | Attribute | Description |
permission | string | the permission level |
Return:
* |
public buildPermissionMethods() source
Build the permission API for the provided permission ranking on the FieldMapperDelegate instance
public buildWith(builder: function(instance: Object, key: string, isList: boolean)): * source
Assign a CustomFieldMapper to the current permission masking
Return:
* |
public passthrough(): * source
Assigns a PassthroughFieldMapper to the current permission masking
Return:
* |
public restrictTo(permission: string): * source
Indicate the following action should be used for this permission level and all others are set to null
Params:
Name | Type | Attribute | Description |
permission | string | the permission level |
Return:
* |
public setPermissionRanking() source
public subTransform(transformerKey: string | Transformer | function(): any, permissionLvl: string): * source
Assign a SubtransformFieldMapper, indicated by @param transformerKey to the current permission masking.
Return:
* |
public transform(permission: string, instance: Object): Promise source
Perform the field transformation at the provided permission level
public when(permission: string): * source
Indicate the following action should be used for the indicated permission level
Params:
Name | Type | Attribute | Description |
permission | string | the permission level |
Return:
* |
Private Methods
private _always() source
Set all permission lvls to use the same field mapper if the always flag is set
private _checkAndReset(fieldMapper: *) source
Restrict transforming if needed. This will go back and null out some lvls we just set if that is desired.
Params:
Name | Type | Attribute | Description |
fieldMapper | * |
private _restrictAtOrAbove(fieldMapper: FieldMapper) source
Restrict access all fields except specified permission lvl and above
Params:
Name | Type | Attribute | Description |
fieldMapper | FieldMapper | the FieldMapper instance |
private _restrictTo(fieldMapper: FieldMapper) source
Restrict access all fields except specified permission lvl
Params:
Name | Type | Attribute | Description |
fieldMapper | FieldMapper | the FieldMapper instance |