Catalog UI Policy Condition, if user has Role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2016 11:38 PM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2016 11:41 PM
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2016 11:50 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 12:03 AM
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.
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.