use of the canView() function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 08:51 AM
I am unable to find any documentation on the canView() function in ServiceNow...
i know that in a background script for example i can use rec.canView() to evaluate if the person at the keyboard can view a catalog item.... but does it work for other record classes.. and can i pass any information into the canView() function... for example the ability to pass in a user sid would be GREAT to be able to evaluate if someone else can view things.. this way we can write scripts in the background script module.. test them completely and THEN move them to where they belong.
has anyone seen ANY documentation of the canView() function? i checked all of the scripts on my system and the only time i find it it doesn't pass in any parameters.
- 3,816 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 08:54 AM
I don't see it documented on developer.servicenow.com which makes me think it is deprecated. I'm interested to see if anyone of our developers have further information on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2018 08:17 AM
Hi Chuck,
Did you get any further information on this?
I have a requirement to hide Catalog Items/Categories in the back-end based on whether or not the Item/Category is available for said user.
Best,
Mark
ps if you wanted more info on the requirement then read on - otherwise don't worry about this bit:
Category A and Item A are not available for User A who has an itil license.
User A cannot request these in the Service Portal, however in the back end if viewing sc_category_list.do can see the Category. They can then click into the Category, see information about it and Click into the related Items. They could click into Item A and see all the details of this Catalog Item also.
We want to prevent that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2018 03:57 AM
To prevent someone from seeing an item in the list, use an ACL. User Criteria applies to whether or not they can see it in the catalog, not a standard list.
Docs: Access control rules
Docs: Contextual security
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2018 04:35 AM
Hi Chuck,
I plan to do so but would like to base the ACL on whether or not the current user can see the Item in the Catalog.
Do you know if canView() is depreciated as you suspected? If so is there some other method I should be using?
Thanks,
Mark