Service portal "you are not authorized" message should pop up if user is not authorized to see any catalog item

Mohammad Danis1
Giga Guru

Go to the Service Portal
Search for "access" - you shouldn't see any catalog item results come back because you're not authorized to order this item as you are not part of use criteria selected under "available for".
Navigate directly to https://dev66541.service-now.com/sp?id=sc_cat_item&sys_id=039c516237b1300054b6a3549dbe5dfc, which is the direct URL to this catalog item. You should see nothing but a blank page. with out any pop...

How can I see a pop up error message.. !!

Please advice..

 

Note: in personal instance message is poping up if user is not authorized but in my instance i want same message to pop up, I tried with the code as in personal instance but no luck ..

any suggestion would be great help.

-Danish

 

 

3 REPLIES 3

Rajesh M1
Giga Guru

Hi Mohammed,

 

Check if your instance is using  ID = "widget-sc-cat-item-v2" widget in your portal. This particular widget throws an error if the unauthorized user attempts to access any item.

 

find_real_file.png

 

Mark answer as correct/helpful if it solves your issue.

Best Regards,

Rajesh M.

Hi Rajesh,

 

Thanks for your reply!!

 

I commented below line in controller and it works.

$scope.data.sc_cat_item.description = $sce.trustAsHtml($scope.data.sc_cat_item.description);

 

Can you please let me know if is there any other way without commenting the above code and also what would be impact if i am commenting this?

Thanks in advance!!

 

Regards,

Mohammad Danih

 

 

Mohammad Danis1
Giga Guru

Hi Rajesh,

 

Thanks for your reply!!

 

I commented below line in controller and it works.

$scope.data.sc_cat_item.description = $sce.trustAsHtml($scope.data.sc_cat_item.description);

 

Can you please let me know if is there any other way without commenting the above code and also what would be impact if i am commenting this?

Thanks in advance!!

 

Regards,

Mohammad Danih