User query business rule conditions

rokasg
Tera Contributor

Hello,

There is an OOTB business rule for sys_user table called user query, which has a condition: gs.getSession().isInteractive() && !gs.hasRole("admin")

It blocks access to deactivated sys_user   records for non admins.

However when I add the additional condition for itil users: gs.getSession().isInteractive() && !gs.hasRole("admin")|| !gs.hasRole("itil") it still doesnt work.

Could someone please help me with this?

Many thanks

Kind regards

RG

1 ACCEPTED SOLUTION

Mihir Mohanta
Kilo Sage

I think you have to use && instead of ||


like


gs.getSession().isInteractive() && !gs.hasRole("admin") && !gs.hasRole("itil")


View solution in original post

4 REPLIES 4

Dubz
Mega Sage

Hi Rokas,



Try putting the two role conditions in their own parentheses:



gs.getSession().isInteractive() && (!gs.hasRole("admin")|| !gs.hasRole("itil"))


rokasg
Tera Contributor

Thanks Dave!


Mihir Mohanta
Kilo Sage

I think you have to use && instead of ||


like


gs.getSession().isInteractive() && !gs.hasRole("admin") && !gs.hasRole("itil")


Thanks Mihir,youre absolutely right:)


I cant believe I missed it