Forum Discussion

Phil_Rosier's avatar
9 years ago

Report of Data Insight Users

Hi, Apology this question is related to internal tables rather than DQL, but hopefully someone on here may be able to help. I need to create an automated report or script that captures a list o...
  • Phil_Rosier's avatar
    9 years ago

    Hi Rishi, thanks for your advice. FYI, I made a couple of changes to the query as shown below to handle the role names so that they the same as displayed in the GUI.

    Regards

    Phil

    SELECT 
         lower(matrixuser.login) AS LOGIN_NAME
        ,lower(matrixuser.domain) AS DOMAIN_NAME

        ,CASE
            WHEN role.name = 'mx_super_admin' THEN 'Server Administrator'
            WHEN role.name = 'mx_sys_admin' THEN 'Product Administrator'
            WHEN role.name = 'mx_storage_user' THEN 'Storage User'
            WHEN role.name = 'mx_user' THEN 'User'
            ELSE role.name
         END AS ROLE

                    
    FROM    rba
        
        INNER JOIN matrixuser ON matrixuser_id = rba.principal_id
        INNER JOIN role ON role.role_id = rba.role_id

    WHERE 
        matrixuser.login != "matrixuser"
        AND rba.object_type = 1
    ;