canUser

Updated:

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

Description

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

Signature

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

Usage

Check a single capability.

const canEatSpam = await tecton.sources.canUser('eatSpam');

Check multiple capabilities.

const canEatSpamAndEggs = await tecton.sources.canUser('eatSpam', 'eatEggs');

if (canEatSpamAndEggs) {
    // User can eat both spam and eggs
}

Additional Information

When using the canUser source, there are important details to keep in mind.

UUX Platform Capabilities

When building extensions for the UUX platform, there are two categories of capabilities that can be checked:

  1. Platform Capabilities - Built-in capabilities set up and provided 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. (e.g., FeatureGroupCustUser/MyCustomFeature, FeatureGroup/CustomModule, Global/PolicyModuleAccess)

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
  ]
}

Parameters

capabilities

Release Notes

Tecton
0.2.0

Platform Support

UUX

Frequently Asked Questions

There is 1 frequently asked question related to this page.