Caplin Trader 5.1.0

Interface: module:ct-services/security/PermissionServiceListener

module:ct-services/security/PermissionServiceListener

This interface must be implemented by any listener class in your application that wishes to be informed of current and future product permissions for the currently logged in user. A listener class can implement one or more of the methods defined by this interface.

Methods

onAttributeChanged(sAttributeName, sAttributeValue)

The registered listener that implements this method subscribes to current and future values of a user attribute. This callback method is invoked when the listener is first registered, and also when the value of the user attribute changes.

Parameters:
Name Type Description
sAttributeName String

The user attribute that the listener subscribed to.

sAttributeValue String

The current value of the user attribute.

See:

onPermissionsChanged(pPermissions, sProduct, sNamespace)

The registered listener that implements this method subscribes to current and future product permissions. The listener can either subscribe to permissions on a set of products, or to permissioned actions on a single product.

This callback method is invoked when the listener is first registered, and also when the requested permissions change.

Parameters:
Name Type Description
pPermissions Array

An array of strings representing the list of permissioned items that the listener subscribed to (either a list of permissioned products, or a list of permissioned actions on a single product).

sProduct String

the product name that was used in the query that led to this permission update.

sNamespace String

the namespace that was used in the query that led to this permission update.

See:

onSinglePermissionChanged(bIsAuthorized, sProduct, sNamespace, sAction)

The registered listener that implements this method subscribes to current and future permissions for an action on a single product. This callback method is invoked when the listener is first registered, and also when the permission for the action changes.

Parameters:
Name Type Description
bIsAuthorized boolean

The current permission for the action (true if the action is allowed, and false if the action is denied).

sProduct String

the product name that was used in the query that led to this permission update.

sNamespace String

the namespace that was used in the query that led to this permission update.

sAction String

the action that was used in the query that led to this permission update.

See: