Click HERE to see how Saviynt Intelligence is transforming the industry. |
12/13/2023 02:16 AM
Hello Team,
We are working on one use case where we need to filter the role,branch region on the request form based on conditions where:
Admins should have access to all region/branches, Area managers should have access to all branches within the region of area managers. We have similar set of other role-->region-->branch selection mappings.
How can we use case condition to filter out the set of role->region->branch mapping? Below is the query which is throwing syntax error in Config for requestable entitlement in ARS.
CASE WHEN '${AppRole}' = 'Admin' THEN 1=1 ELSE ev.customproperty1 in (select costcenter from Users where userkey in (${requestee})) END
Thanks
12/13/2023 08:32 AM
Use ternary operator instead of case when. HQL should be used.
12/14/2023 12:32 AM
Hi @rushikeshvartak ,
I tried using the ternary operators as below:
I am still getting syntax error :
Could you please help me out on this ?
Thanks
12/14/2023 01:43 AM
Please try the following:
${(AppRole=='Admin')? return '1==1': return 'ev.customproperty1 in (select costcenter from Users where userkey in ('+requestee+'));'}
12/14/2023 02:42 AM
Hello @Rajesh-R ,
This is throwing Syntax error:
Is there any other approach the given conditions can be achieved in Entitlement type?
12/14/2023 02:56 AM - edited 12/14/2023 02:57 AM
Please try the below:
((${AppRole}='Admin' and 1=1) or (${AppRole}!='Admin' and ev.customproperty1 in (select costcenter from Users where userkey in (${requestee}))))
12/14/2023 03:06 AM
Hi @Rajesh-R ,
Thanks for your prompt response.
I tried the above query and it is still throwing Syntax Error.
12/14/2023 03:25 AM
is AppRole your Dynamic Attribute?
12/14/2023 03:27 AM - edited 12/14/2023 03:27 AM
Hi Rajesh, AppRole is an dynamic attribute as well as an entitlement type that we are using to filter based on selection of approle->region will be populated-->branch will be populated upon region selection.
12/14/2023 03:30 AM
Could you drop a screenshot of dynamic attribute list from your Endpoints
12/14/2023 03:49 AM
Here is the screenshot of the dynamic attribute from the endpoint.
Let me know if you need any more details.
12/14/2023 03:37 AM - edited 12/14/2023 03:38 AM
Try the following:
(('${AppRole}'='Admin' and 1=1) or ('${AppRole}'!='Admin' and ev.customproperty1 in (select costcenter from Users where userkey in (${requestee}))))
Refer the usage here:
Search for : Config For Requestable Entitlement In ARS
12/14/2023 03:53 AM
@tpawle - Try the following:
(('${AppRole}'='Admin' and 1=1) or ('${AppRole}'!='Admin' and ev.customproperty1 in (select costcenter from Users where userkey in (${requestee}))))