Views:
TypeRead/writeAuthorAvailability
Data providerReadFinbourneProvided with LUSID

The Sys.User.Role provider enables you to write a Luminesce SQL query that lists information about users and their assigned roles in Luminesce.

Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and read user role data. This should automatically be the case if you are the domain owner. If you do not have access to user role data then the query only returns your own user role data.

See also: Sys.User

Basic usage

select * from Sys.User.Role where <filter-expression>;

Query parameters

Sys.User.Role has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Sys.User.Role' and FieldType = 'Parameter';

Data fields

By default, Sys.User.Role returns a table of data populated with particular fields (columns). You can return a subset of these fields.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Sys.User.Role' and FieldType = 'Column';

Note: Fields marked 'main' are returned by queries that include a caret character, for example select ^ from Sys.User.Role.

    Examples

    Note: For more example Luminesce SQL queries, visit our Github repo.

    Example 1: Retrieve first 10 user roles 

    select * from Sys.User.Role limit 10

    Example 2: Retrieve all roles assigned to a particular user

    select RoleCode from Sys.User.Role where UserId = '00usi5hab8sJgBgF8p7'
    

    Example 3: Retrieve description for a particular role

    select RoleDescription from Sys.User.Role where RoleCode = 'lusid-administrator'