canUser

Updated:
Supported Platforms:
UUX

Check if the current user has one or more platform capabilities or user properties.

canUser checks the platform for the given user capabilities, resolving to a value of true if all given capabilities are permissible and false if not.

It takes an argument list of strings representing the capabilities you want to check for and returns a Promise<boolean>.

Details

Type

tecton.sources.canUser(...capabilities: string[]): Promise<boolean>

There are two categories of capabilities that can be checked:
1. Platform Capabilities - Built-in permissions from the platform (e.g., canTransfer, canRDC, canDomesticWire)
2. User Properties - Custom properties configured per user via the Q2_UuxUserProperty database table. These allow FIs and platform administrators to create custom feature flags.

Example

tecton.sources.canUser('eatEggs', 'eatSpam').then(function(isAllowed) {
  if (isAllowed) {
    // do something
  }
});

// returns Promise<boolean>

In UUX versions 4.7.1.2+, you can use the listCapabilities helper function to see all capabilities available for the current user by opening the browser console and running:

window.listCapabilities()

This returns an object with two arrays:

{
  platformCapabilities: [
    { name: 'canTransfer', canUser: true },
    { name: 'canRDC', canUser: false },
    // ... all platform capabilities
  ],
  userProperties: [
    { name: 'FeatureGroupCustUser/MyCustomFeature', canUser: true },
    { name: 'Global/PolicyModuleAccess', canUser: true },
    // ... all user properties from Q2_UuxUserProperty
  ]
}

Frequency Asked Questions

There is 1 frequently asked question related to this page.

Release Notes

Initial Release