- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 12:14 AM
What condition shall I put on VIEW context menu so that admin can see the view but itil cannot.
Actually admin has itil role by default.
Please do answer the condition .
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 12:27 AM
Hi Manisha,
The condition should be as of below. You just need to add the bold portion.
ListProperties.canChangeView() && gs.hasRightsTo('ui/context_menu.view/read', null) && gs.hasRole("admin")
I hope this helps. Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 12:27 AM
Hi Manisha,
The condition should be as of below. You just need to add the bold portion.
ListProperties.canChangeView() && gs.hasRightsTo('ui/context_menu.view/read', null) && gs.hasRole("admin")
I hope this helps. Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 02:18 AM
Hi monu,
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 12:29 AM
Hello Manisha,
Try the UI Script.
Create a new UI Script, and check the Global checkbox.
Use the script as following:
T
To disable the context menu for roles except admin:
- addLoadEvent(hideContextMenu);
- function hideContextMenu(){
- try{
- if(!g_user.hasRole("admin")){
- this.contextShow = function(){return false;}
- }
- }
- catch(e){
- alert(e);
- }
- }
Thanks,
Surya Amara
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 01:12 AM
Are you simply after making a view (a list structure) available to specific users? (i.e.: users with a specific role?)
If so, System UI > Views allows you to define the roles that are able to see (and therefore use) a specific view.