- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:12 PM
In the incident table, I have a group field
Users of group1 can only see and edit the records of group1
Users of group2 can only see and edit the records of group2
I want to achieve such permission control
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 04:00 AM
Hi,
so since you are having u_group field as reference on your table
you can use this and it would show only those records where logged in user is member of u_group
var groups = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
current.addQuery('u_group', 'IN', group.toString());
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 02:20 AM
You can follow below article:
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 04:00 AM
Hi,
so since you are having u_group field as reference on your table
you can use this and it would show only those records where logged in user is member of u_group
var groups = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
current.addQuery('u_group', 'IN', group.toString());
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader