How can I hide records on a table based on the user's group?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2018 07:31 PM
I would like to hide certain records on the Requested Item (sc_req_item) table based on a user's group or role.
For example, if a user submits a "Request to Pull Email" Service Catalog request, a record on the sc_req_item will be created. I want these requests to be only visible to users in the groups "ITSS-MRS Security" and "ITSS-ECS E-Mail". I have created a beforeQuery Business Rule that runs on records with item = 'Request to Pull Email', but I am having trouble with the code in the advanced section of the business rule (the code should go something like this):
if (user.group == "ITSS-MRS Security" || user.group == "ITSS-ECS E-Mail" || user.role == "admin") {
visible = true
} else {
visible = false
}
How do I finish this code so that only those users can see the records?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 07:52 PM
Hey Shishir,
I tried this and it's not working.
Any idea why?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2018 08:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 07:53 PM
Hey Jaredholm,
Did you ever figure this out? I am having the same issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 08:03 AM
You could do the following in a query business rule
if (gs.getSession().isInteractive()) {
if (!gs.getUser().isMemberOf('GROUP ONE NAME')) {
if (!gs.getUser().isMemberOf('GROUP TWO NAME)) {
if (!gs.getUser().isMemberOf('GROUP THREE NAME)) {
current.addEncodedQuery('cat_item!=*SYS ID OF CATALOG ITEM*');
}
}
}
}