Caplin Trader 4.7.1

Class: module:caplin/services/testing/PermissionServiceFixture

module:caplin/services/testing/PermissionServiceFixture

Constructor

new module:caplin/services/testing/PermissionServiceFixture()

Constructs a PermissionServiceFixture. The PermissionServiceFixture serves to provide a way for tests to interact with the PermissioningService providing trading and view allow or deny permissions on tiles and instruments.

Use of the Fixture assumes that a module:caplin/trading/testing/PermissioningServiceStub is registered as a service on the module:caplin/core/ServiceRegistry under the namespace "caplin.services.security.PermissionService".

Tests may use the PermissionServiceFixture to:

  • deny 1 click spot trading on /FX/GBPUSD when("permissions.deny => ['/FX/GBPUSD', 'TradeProtocol', 'ESP']")
    and("permissions.deny => ['/FX/GBPUSD', 'TradeType', 'SPOT']")
    ...
  • allow view permissions on /FX/GBPUSD when("permissions.allow => ['/FX/GBPUSD', null, 'VIEW']")
    ...
Implements:

Methods

canHandleProperty()

PermissionServiceFixture handles properties 'allow' and 'deny'.
Implements:
See:

doGiven(propertyName, value)

This method is used to inform listeners on the PermissioningService about the permissions change on tile or instruments.
Parameters:
Name Type Description
propertyName String The property name.
value Variant The value to check.
Implements:
See: