hide row in a table list

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 11:31 AM
We are working on making it so that all users can see the application in the CMDB in a List just like if you went to configuration > Applications for ITIL users. I have been asked if there is a way to hide an application from the list view if IT Owner (one of the fields) is empty. Does anybody know if this is possible and how I could go about doing it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 11:42 AM
I would suggest updating the ACLs so that you have two read rules: If ITIL, allow read. Then have one without a role associated with it and script the ACL to check the IT Owner field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 11:43 AM
Hi,
You need to write a before query business rule on the required table to achieve this requirement.
if (gs.getSession().isInteractive()) {
if(gs.hasRole('itil')){
current.addQuery('it_owner', '!=', '');
}
}
Thanks
Please 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
04-18-2017 11:44 AM
Hello Brian,
You can create a BEFORE query business rule to restrict record access to certain rows as per your req.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 11:50 AM
Do you want to hide it for just non itil users?
A business query rule can do the trick.
Set the condition of the query to return true if the user does not have the itil role
In the script, add
var qc = current.addQuery("YOURITOWNERFIELD=NULL
")
to then add a query filtering out records where the it owner is empty.