UserRoles (PQL)

Returns the a delimited string of role names for the currently logged in user. 

  • Returned Output: Text
  • Library: PQL \ Granular \ Identity
  • Version: 2023.00.000
  • Compatibility: Pyramid Query Language (PQL) data sources

Syntax

UserRoles()

Comments
  • The function returns a value, rather than performing an operation on a given column.The value can then be used to drive derivative logic. The various Identity values are often used to secure data based on the current end user or create personalized values for the end user.
  • For details on how to employ and use this function see the custom column overview.
Different Function types

Examples

This example injects the current user's roles into other functions (IF and Contains) to drive which column should populate the result set. The Contains function is used to check if the current user's roles contains a certain value ("CEO"), triggering a different column treatment if it does.

If( Contains( UserRoles(), "CEO"), "[OrgChart].[Management]", "[OrgChart].[Cost Centers]" )