Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

To Fetch all roles and it's associated entitlements for specific endpoint assigned to user.

AravindK
Regular Contributor
Regular Contributor

Hi Team,

We have an requirement for some users , we need to fetch all the roles which are assigned to user and also entitlements which are added to those roles(note: entitlements we need to fetch for only one specific endpoint(Ex: SAP) and not for other endpoints. We are trying to fetch the data ,but the not the accurate result. Can someone help me with the query??

Thanks,
Aravind

4 REPLIES 4

DixshantValecha
Saviynt Employee
Saviynt Employee

Hi @AravindK,

We kindly request additional details regarding the output you have obtained and the query that has been formulated. Providing further information would greatly aid in our ability to thoroughly address your inquiry.

AravindK
Regular Contributor
Regular Contributor

Hi @DixshantValecha ,
I am using the below query to get all the roles which are assigned to the user. It is fetching the only roles information but not the entitlements information. 

Ex: From the output of this query, if we take one role and if that role has the entitlements of multiple application but we are looking for only one application entitlements. Please help me with the query to get the data at a time.

select DISTINCT R.ROLE_NAME,U.USERNAME,U.FIRSTNAME,U.LASTNAME,U.CITY,U.EMAIL,U.OWNER,U.JOBCODE FROM role_user_account RO
INNER JOIN roles R ON RO.rolekey=R.rolekey
INNER JOIN users U ON RO.userkey = U.userkey
where U.userkey in('13')

Thanks,
Aravind

Please try below and see if it meets your requirement.

dgandhi_0-1682084718835.png

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Based on your description, it seems that you are looking for a query that retrieves both role information and entitlement information for a specific user, where the entitlements are filtered by a specific application. Here's an example of a query that could achieve that:

SELECT DISTINCT R.ROLE_NAME, U.USERNAME, U.FIRSTNAME, U.LASTNAME, U.CITY, U.EMAIL, U.OWNER, U.JOBCODE, E.ENTITLEMENT_NAME, E.APPLICATION_NAME
FROM role_user_account RO
INNER JOIN roles R ON RO.rolekey = R.rolekey
INNER JOIN users U ON RO.userkey = U.userkey
INNER JOIN role_entitlement RE ON R.rolekey = RE.rolekey
INNER JOIN entitlements E ON RE.entitlementkey = E.entitlementkey
WHERE U.userkey IN ('13') 
AND E.APPLICATION_NAME = 'Your_Application_Name';