How to hide widget based on user role?

Bob33
Kilo Contributor

how can we hide and show an widget based on the role of the user.

1 ACCEPTED SOLUTION

Dipankar Kundu
Giga Expert

Hi bob,

First check weather Service Portal User Criteria Support Plugin is active or not, it not first activate the plugin.

Then open any page and in related list you will see the “Can View”, “Cannot View”.

There you can add any role as well as you can edit and add the role to that page, and to add role to any specific widget open the instance of that widget from any page and in the related list of that widget you will find “Can View” and “Cannot View”.

View solution in original post

6 REPLIES 6

Prins Kumar Gup
Giga Guru

Hi,

Is there another way to hide a particular widget based on the role.

HTML:-

<div class="panel panel-default" ng-if = "c.data.isAdmin == 'true'">

<div class="panel-body">
<button type="button" class="btn btn-primary btn-block" ng-click="function()">Button</button>
</div>
</div>

Server Script:-

data.isAdmin = gs.getUser().hasRole('admin');

 

Please mark it as helpful or correct.!!

Thanks

PKG

Dipankar Kundu
Giga Expert

Hi bob,

First check weather Service Portal User Criteria Support Plugin is active or not, it not first activate the plugin.

Then open any page and in related list you will see the “Can View”, “Cannot View”.

There you can add any role as well as you can edit and add the role to that page, and to add role to any specific widget open the instance of that widget from any page and in the related list of that widget you will find “Can View” and “Cannot View”.