Restrict part of a portal widget with user criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 02:56 AM
Hoping a portal development specialist can help.
I have a 'Contact Us' page that displays contact details for the three functions HR, Finance and IT. Users click on an icon representing each area and, based on their location, there appears below all the details they need. I also have an established user criteria that defines a particular employee population who are transitioning into the support of these functions.
The requirement is for this particular group of employees to only be able to see the IT button at the moment (as the other business desks do not support them yet.)
The problem is that I have been told that user criteria can only be applied to the widget and not the html inside the widget.
Can anyone think of a way that user criteria can be used in this scenario?
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 03:03 AM
Hi you need to glide in server script check whether the logged in user is a part of group if yes and place this as anwer = true
and in HTML widget you need to place using ng-if to check and inside that you can place the IT button
Example
<li ng-if = "data.answer1 == true">//satisfy condition
<a href="/link">IT</a>
</li>
//IT should be hidden
var currentUserID = gs.getUserID();
var userGR1 = new GlideRecord('sys_user');
if(userGR1.get(currentUserID)){
if(condition)
{
data.answer1 = true;
}
else
{
data.answer1 = false;
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 03:03 AM
Hello