Catalog UI Policy Condition, if user has Role

Lyubomir1
Tera Contributor

Hello Everyone,

I need to build a condition in a Catalog UI Policy that makes the requested for field read-only if the user does not have an ITIL Role. I need help with the dot walking in the related field so i can access the users Roles. Currently I\m using the Requested for >> User fields >> Roles but it is not working, any suggestions? The policy applies to a catalog variable set. Thanks!

New Bitmap Image.bmp

3 REPLIES 3

pash0405
Kilo Contributor

Hi Iyubomir,



Why you are using requested for? You have to check the logged in User role right? So you can do it using script option in UI Policy where you can check the role of logged in user & then set the condition accordingly...


Hello,



Thanks for the fast reply. For some reason none of the scripts are able to run on the Service Portal, however they work when i 'Try it' the item on the back end. However the UI actions work ok on the   Service Portal.


tanumoy
Tera Guru

By using dot walking in the UI Policy condition you are basically accessing the Roles marked in yellow in below screenshot, not the roles from the Related List.



Capture.JPG



So, basically I don't think this is a correct way.



Now, the next point, do you want to check the role of current logged in user or the user from the requested_for variable.


If it is for the current logged in user then you can get it by a Catalog Client script, otherwise you have to use GlideAjax to check the role of the user selected in the requested_for variable.



Let me know in case you need help in the scripts.