Class
caplin.services.testing

PermissionServiceStub

The PermissionServiceStub serves to provide a way for tests to stub a caplin.services.security.PermissionService providing trading and view allow or deny permissions on tiles and instruments.

Register a caplin.trading.testing.PermissioningServiceStub service on the caplin.core.ServiceRegistry under the namespace "caplin.services.security.PermissionService".

Constructor Summary

Attributes Name and Description
caplin.services.testing.PermissionServiceStub()

Constructs a caplin.services.testing.PermissionServiceStub.

Method Summary

Attributes Name and Description
void addRegistrationListener(Function fCallback)

Allows the user to register a callback method that will be caled every time addPermissionListener() is called this enable a workbench tool to update its GUI.

void allow( sProduct, sNamespace, sAction)

Notifies the appropiate listeners that a permission defined by namespace, product and action is allowed

void deny( sProduct, sNamespace, sAction)

Notifies the appropiate listeners that a permission defined by namespace, product and action is denied

void setAllPermissionsForProductSets(Object mPermissionedProducts)

This method allows you to override the existing list of product sets.

void setProductSetsPermissions(String sNamespace, Array pProducts)

Allows to set product sets permissions.

Methods implemented from class caplin.services.security.PermissionService:
addAttributeListener, addGlobalPermissionListener, addPermissionListener, addPermissionSetListener, addProductPermissionsListener, addToboUserAttributeListener, canUserPerformAction, canUserPerformGlobalAction, getAllowPermissions, getAllPermissions, getDenyPermissions, getPermissionedProducts, getToboAllowedProducts, getToboDeniedProducts, getToboUserAttribute, getUnpermissionedProducts, getUserAllowedProducts, getUserAttribute, getUserDeniedProducts, removeListener

Constructor Detail

caplin.services.testing.PermissionServiceStub()

Constructs a caplin.services.testing.PermissionServiceStub.

Method Detail

void addRegistrationListener(Function fCallback)

Allows the user to register a callback method that will be caled every time addPermissionListener() is called this enable a workbench tool to update its GUI.

Parameters
Function fCallback Method to be called any time addPermissionListener is called

void allow( sProduct, sNamespace, sAction)

Notifies the appropiate listeners that a permission defined by namespace, product and action is allowed

Parameters
sProduct
sNamespace
sAction

void deny( sProduct, sNamespace, sAction)

Notifies the appropiate listeners that a permission defined by namespace, product and action is denied

Parameters
sProduct
sNamespace
sAction

void setAllPermissionsForProductSets(Object mPermissionedProducts)

This method allows you to override the existing list of product sets. Product set listeners will be notified about product sets changes.

Parameters
Object mPermissionedProducts Product set map. Each key will represent a namespace and its value will be an array of products.

void setProductSetsPermissions(String sNamespace, Array pProducts)

Allows to set product sets permissions. It will callback on the product sets listeres registered for the given namespace.

Parameters
String sNamespace Namespace identifying the product set.
Array pProducts Array of products for the given namespace.