Hide widget for a group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 09:14 PM
Hi Community,
How to hide a service portal widget for a group.
I need help in the logic.
Thanks,
Poorva Bhawsar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 09:42 PM
Hi @Poorva Bhawsar ,
Assign user criteria to pages, widgets, or widget instances to limit user access to content in a portal.
Before you begin
Activate the Service Portal User Criteria Support (com.glide.service-portal.user-criteria) plugin and set the glide.service_portal.user_criteria_enabled system property to true.
Role required: admin or sp_admin
About this task
You can apply several user criteria records to a single portal item.
Procedure
- In the Service Portal Configuration page (Service Portal > Service Portal Configuration), open the Page Editor.
- Select a page from the list.
- Select a page, widget, or widget instance node from the page tree.
- Under related lists, click Who Can View or Who Cannot View.
- Click New.
- Select a criteria from the Can View or Cannot View list.
Selecting criteria from the Can View or Cannot View list applies user criteria records created in Create a user criteria record for Service Portal to the selected page, widget, or widget instance.
- Click Save.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 09:45 PM
Here i want to hide a reopen widget when an incident is assigned to xyz group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 09:49 PM
Hi @Poorva Bhawsar ,
In server script you can give like if logged in user is member of that respective group. You can hide that widget using the flag passing as true or false to html code.
Html:
<div ng-if=data.showwid>
//your widget code
</div>
Server script:
var wid = gs.getUser().isMemberOf("your group name");
if(wid == true)
data.showwid = false;
else
data.showwid = true;
Please mark it correct. If it is helpful.
Thanks and Regards,
Allu Gopal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2024 09:32 PM
Can you help me that i am adding the code at correct place or not?
Here is the HTML part.
<div>
<div class="dropdown" id="child-case-tabs" ng-if="data.showActions">
<button type="button" id="actions-button" class="btn btn-default dropdown-toggle action-btn" data-toggle="dropdown" style="width : 100%" aria-haspopup="true" ng-init="setFocusOnActionButtons()">
${Actions}
<span class="fa fa-caret-down"></span>
</button>
<ul class="dropdown-menu pull-right" id="actionList">
<li ng-if="data.canResolve">
<a href="javascript:void(0)" ng-click="$event.stopPropagation();resolveIncident()">${Resolve}</a>
</li>
<div ng-if=data.showwid>
<li ng-if="data.canReopen">
<a href="javascript:void(0)" ng-click="$event.stopPropagation();reopenIncident()">${Reopen}</a>
</li>
</div>
<li ng-if="data.canClose">
<a href="javascript:void(0)" ng-click="$event.stopPropagation();closeIncident()">${Close}</a>
</li>
</ul>
</div>
</div>
Here is the server script.