A helper class that fronts module:ct-services/security/PermissionService
, and provides higher level
permissioning information that can be used throughout the application.
Methods
add Accounts Listener(sInstrument, oListener) → {int}
Add a listener that will be called back each time the permission on the given instrument changes in respect to the set of accounts the user has.
Parameters:
Name | Type | Description |
---|---|---|
sInstrument |
String | |
oListener |
Object | Listener to receive onAccountsPermissionsChanged() callbacks |
Returns:
a unique identifier for this listener so it can later be removed using module:ct-trading/service/TradePermissionService#removeListener
- Type
- int
add Instrument Viewable Listener(sInstrument, oListener) → {int}
Add a listener that will be called back each time the permission on the given instrument changes in respect to whether is it is viewable.
Parameters:
Name | Type | Description |
---|---|---|
sInstrument |
String | |
oListener |
Object | Listener to receive onViewPermissionsChanged() callbacks |
Returns:
a unique identifier for this listener so it can later be removed using module:ct-trading/service/TradePermissionService#removeListener
- Type
- int
add Ticket Tradable Listener(sInstrument, oListener) → {int}
Add a listener that will be called back each time the permission on the given instrument changes in respect to whether ticket trading is possible.
Parameters:
Name | Type | Description |
---|---|---|
sInstrument |
String | |
oListener |
Object | Listener to receive onTicketPermissionsChanged() callbacks |
Returns:
a unique identifier for this listener so it can later be removed using module:ct-trading/service/TradePermissionService#removeListener
- Type
- int
add Tile Tradable Listener(sInstrument, oListener) → {int}
Add a listener that will be called back each time the permission on the given instrument changes in respect to whether tile trading is possible.
Parameters:
Name | Type | Description |
---|---|---|
sInstrument |
String | |
oListener |
Object | Listener to receive onTilePermissionsChanged() callbacks |
Returns:
a unique identifier for this listener so it can later be removed using module:ct-trading/service/TradePermissionService#removeListener
- Type
- int
can Trade InTicket(sInstrument)
Determine whether the user is permitted to trade the given instrument within a ticket.
Parameters:
Name | Type | Description |
---|---|---|
sInstrument |
String | the instrument to be traded. |
can Trade InTile(sInstrument)
Determine whether the user is permitted to trade the given instrument within a tile.
Parameters:
Name | Type | Description |
---|---|---|
sInstrument |
String | the instrument to be traded. |
filter Out Non View Permissioned Base Currencies(pList OfBase Currencies, pComplete List)
Returns a filtered array of currency bases, filtering pListOfBaseCurrencies, letting through the filter only the currency bases that are VIEW permitted.
Parameters:
Name | Type | Description |
---|---|---|
pListOfBaseCurrencies |
Array | an array of the possible currency bases. |
pCompleteList |
Array | an array containing all possible currencies. |
filter Out Non View Permissioned Currency Pairs(pList OfPairs)
Returns a filtered array of currency pairs, filtering pListOfPairs, letting through the filter only the currency pairs that are VIEW permitted.
Parameters:
Name | Type | Description |
---|---|---|
pListOfPairs |
Array | an array of the possible currencies. |
remove Listener(nListener Id)
Remove a previously registered listener using the given identifier
Parameters:
Name | Type | Description |
---|---|---|
nListenerId |
int | The id of the listener to remove. |