OIM SQL Query for Direct or Indirect Roles on Users

Dean the Identity Ninja


    We need to build a query that takes a user and lists all their roles. The problem is that I need to have a column that says whether the role in question is given to the user directly or indirectly with inheritance. OIM does this within the self service portal, but I need a query. What tables would I need to get this information, or what SQL query would be able to help make this happen?


    Query Input: username

    Query Output:

    Role NameDescription
    Membership TypeAssigned OnRequest IDStart DateEnd Date


    this is a roleDirect1/1/19991234561/16/1999
    role1.5this is a role of a rollIndirect1/1/19991234571/16/1999


    This question is similar, but nothing helpful was gained from the answers. Query regarding Role Inheritance needed