Visiblity of the catalog items for all users

phr
Tera Contributor

Hi All,

 

I have a requirement where a particular catalog item needs to be visible to all users , We have also written this code in "available for" section .

phr_0-1714538711553.png

But still users with the snc_internal aren't able to see the catalog item in the portal. How to achieve this?

16 REPLIES 16

On the advance condition in the scripting just for one line as :

answer = true;

 

See if it helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Or ! @phr 

Try this solution in the KB for snc_internal role: skip / modify necessary steps.

 

  1. Navigate to any Out of the box Instance
  2. If snc_internal and snc_external roles are not added to instance, install the "Explicit Roles" plugin. Refer to "Explicit Roles" documentation for more information
  3. Once plugin is installed. Create new user or edit roles for an existing User so User has only snc_external role - This is for testing purpose. 
  4. Navigate to service portal ➔ homepage. For Out of the box it is index page.
    https://<your-instance>.service-now.com/nav_to.do?uri=sp_page.do?sys_id=46cc384147532100ba13a5554ee49009

  5. Give snc_external role to page. 
  6. Go to sc_cat_item page and give snc_external role to page.
    https://<your-instance>.service-now.com/nav_to.do?uri=sp_page.do?sys_id=9f12251147132100ba13a5554ee490f4

  7. Go to widget SC Catalog Item and give snc_external role to widget
    https://<your-instance>.service-now.com/nav_to.do?uri=sp_widget.do?sys_id=3c29786e87133200e0ef0cf888cb0bdf

  8. Open your Catalog item for ex. Apple ipad 3. 
  9. Add related lists "Available for " and "Not available for". 
  10. Go to "Not available for" related lists and edit it. Remove SNC External. 
  11. Go to "available for" related lists and edit it. Add SNC External. 
  12. Login as External User created in step 3. 
  13. Go to Service Catalog and browser by category - Apple ipad 3 will be available for user. 
  14. Same steps can be followed for any record producer.

Note: If your record producer is calling any script include then separate ACL should be added so external users can pass and access script include so functionality works as expected. 

If ACL is not added or respective ACL are failing then there will be console errors and debugging logs will show which ACL is failing.

 

REF:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0728420

 

I hope it helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Sandeep Rajput
Tera Patron
Tera Patron

@phr There is no hasRoles method instead you need to use hasRole. Please update your code as follows.

 

if(gs.hasRole('snc_internal')){
answer=true;
}

Hope this helps.

Hi @Sandeep Rajput 

 

We tried this and the results are the same.

 

Ramz
Mega Sage

Hi @phr ,

Test with any other catalog item in your instance . In your instance is any catalog item made available to all users?Then compare your catalog item with it.

 

If no catalog item is visible to all users then probably it has to do something with your widget in portal. There the items might me hided with role

Check and let me know

Please mark my answer correct/helpful if it resolved your query