UserRolesSet
Returns the a collection of role names for the currently logged in user.
- Returned Output: Text List
- Library: PQL \ Common \ Identity
- Version: 2018.00.000
- Compatibility:
- Can be combined with and other PQL function throughout the application.
- It CANNOT be used with MDX or VBA functions. But it can be used on MDX-based content in other parts of the application.
Syntax
UserRolesSet()
Comments
- The function returns a list of the user's roles
- There are no input parameters
- The function is often used in driving member level security for data models - allowing a data model to be customized for each user logging into the application.
Different Function types
- The other "identity" functions can be used to secure and customize the analytics experience. For more see the UserName function.
- Also see the UserRoles function,
Examples
This example shows how to check the roles list for a user to see if it contains a particular role using the HasItem function.
If( HasItem(UserRolesSet(), "Role A"), "[security].[country].[USA]", "[security].[country].[Australia]" )
So if a user domain\jsmith logged in and belongs to Role A and Role B, the above function will return true, and the resulting string [security].[country].[USA] will be returned by the If statement.