Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Request to be Auto Rejected if a user part of Sav Role and Requesting for Self

userr
New Contributor III
New Contributor III

Hi,

Request to be Auto Rejected if a user part of Sav Role and Requesting for Self

Using the below Query in "IF-ELSE" in workflow and getting ERROR - Request not Submitted(contact system Admin)

(requestedby.authorities.collect { it.authority }.contains("ROLE_ADMIN")) AND (com.saviynt.ecm.identitywarehouse.domain.Users.executeQuery("select u.id from Users u where u.userkey= '${requestedby?.id}'")?.size() != 0)

If I use only this requestedby.authorities.collect { it.authority }.contains("ROLE_ADMIN")  it is working fine.

Thanks in advance. Please let me  know if any details are required



5 REPLIES 5

NM
Honored Contributor II
Honored Contributor II

Hi @userr use another block for self request check if if and else

requestedby.id=user.userkey or 

requestedby.id=user.id

 

userr
New Contributor III
New Contributor III

Hi @NM  thanks for the response.

There is already once condition is in place. The expected flow is like this.

1. User with ROLE_ADMIN can submit the request and it will be Auto Approved when submitting Others
but when he is making changes for Self it should be Rejected
2. Users with other Roles also can submit for Self where it can go for Next Approver or Auto Approved based on 'region code'

Your logic can make the ROLE_ADMIN also will be Auto Approved and not check for next condition.

Consider case where User with ROLE_ADMIN and regioncode is not Employee it will go to next approval

Thanks

userr_0-1727423353372.png

 

userr
New Contributor III
New Contributor III

Complete Workflow
userr_1-1727423948752.png

Check both condition using SQL query instead of it.authorities


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

userr
New Contributor III
New Contributor III

Hi @rushikeshvartak 

Thanks for the response.

Could you please share the query, that would be great