Description
This article discusses how to check if a logged-in user has a role in Service Portal widgets.
Procedure
For example, if you want to check if the logged-in user has an admin role and displays a content using the HTML template.
In the server script, you can something like the following.
data.result = false;
if (gs.hasRole("admin")){
data.result= true;
}
Then you can check for the data.result variable in the HTML template using the following line
<div ng-if=data.result>
Applicable Versions
All available versions