Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/18/2024 12:32 PM
Hello
I am trying to write a query that can list all the acces added/revoked from april to now
How can i do that please
The acces could be entitlements or roles
Thank you
Solved! Go to Solution.
09/18/2024 12:51 PM - edited 09/18/2024 12:53 PM
Refer https://forums.saviynt.com/t5/tag/SQL_RequestHistory/tg-p
09/18/2024 01:40 PM
Hello thanks for theupdate
i tried to add the roles and the first and last name of the users also,but it s not working
09/18/2024 01:48 PM
You need extract roles from separate query from role_user_accounts table
09/18/2024 05:59 PM
by using this query below i was able to extract all the added entitlements to users during a period of time.
SELECT u.USERNAME AS 'USERNAME', u.FIRSTNAME AS 'FIRST NAME', u.LASTNAME AS 'LAST NAME', ev.entitlement_value
FROM arstasks a
JOIN entitlement_Values ev ON ev.entitlement_Valuekey = a.entitlement_valuekey
JOIN users u ON u.userkey = a.userkey
WHERE a.tasktype IN (1, 2)
AND a.status = 3
AND a.updatedate >= '2024-04-01'
AND a.updatedate <= CURRENT_DATE;
However how can i modify the query to extract the revoked acces?
09/18/2024 06:23 PM
SELECT DISTINCT u.username AS 'USERNAME',
u.firstname AS 'FIRST NAME',
u.lastname AS 'LAST NAME',
r.role_name AS 'Access',
'Role' AS type
FROM arstasks a
JOIN roles r
ON r.rolekey = a.assignedfromrole
JOIN users u
ON u.userkey = a.userkey
WHERE a.tasktype IN ( 1, 2 )
AND a.status = 3
AND a.updatedate >= '2024-04-01'
AND a.updatedate <= CURRENT_DATE
UNION
SELECT DISTINCT u.username AS 'USERNAME',
u.firstname AS 'FIRST NAME',
u.lastname AS 'LAST NAME',
ev.entitlement_value AS 'Access',
'Entitlement' AS type
FROM arstasks a
JOIN entitlement_values ev
ON ev.entitlement_valuekey = a.entitlement_valuekey
JOIN users u
ON u.userkey = a.userkey
WHERE a.tasktype IN ( 1, 2 )
AND a.status = 3
AND a.updatedate >= '2024-04-01'
AND a.updatedate <= CURRENT_DATE;