- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2021 11:59 PM
Hi, experts.
I would like to fix View by user role.
I have created one user and one role and assigned that role to that user.
I would like to do the following.
1. I would like to create a view that only that user can use.
2. If that user is in control, the view will appear on the screen.
3. However, if the controller is not that user, then the view cannot be used.
4. (if possible) It cannot be changed from its default view if that user is in control.
Please give me your hand.
I'm not good at English, If these sentences is hard to read for you, I'm apologize.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2021 05:22 AM
You can go to the UI views under the System UI look for your View in list, Open the record and you will be able to see. If no role is assigned then by default views are visible to Admin or Itil-user since they have access to create view and control them.
If you don't want admin to have access to the view you need to write another If statement and add the gs.hasRole("admin") and answer=false. Only this way you can revoke the admin access to views. As being admin, all access is available to them.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2021 01:07 AM
Hi,
You can use view rule to control view based on logged In user.
Please check below link for similar solution:
Thanks,
Anil Lande
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2021 03:13 AM
Hi Inoue,
1. Go to the View Rules module under the System UI application in Application Navigator.
2. Create a New view rule, Choose the desired Name and the Table that has the view you created.
3. After this checked the Advanced option you will see on the form.
4. Script will be available, Here you will define the role that you have created in script
gs.hasRole("your role").
5. In answer variable you will write the view name that you have created answer="your view".
For those who should not access the view write answer=" " or answer=null.
6. View the image below to understand the script.
7. In case you don't know the exact view name, you can navigate to Views under System UI application.
Regards,
Ashir Waheed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2021 04:41 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2021 05:22 AM
You can go to the UI views under the System UI look for your View in list, Open the record and you will be able to see. If no role is assigned then by default views are visible to Admin or Itil-user since they have access to create view and control them.
If you don't want admin to have access to the view you need to write another If statement and add the gs.hasRole("admin") and answer=false. Only this way you can revoke the admin access to views. As being admin, all access is available to them.