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".
Attributes | Name and Description |
---|---|
|
caplin.services.testing.PermissionServiceStub()
Constructs a |
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. |
►
caplin.services.testing.PermissionServiceStub()
Constructs a caplin.services.testing.PermissionServiceStub
.
►
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.
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
sProduct | ||
sNamespace | ||
sAction |
►
void
deny( sProduct, sNamespace, sAction)
Notifies the appropiate listeners that a permission defined by namespace, product and action is denied
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.
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.
String | sNamespace | Namespace identifying the product set. |
Array | pProducts | Array of products for the given namespace. |