Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 10:06 AM
I have a button in the portal that needs to be hidden if the logged in user does not have a specific role. Here is my button HTML:
<button
type="button"
class="btn btn-dash {{c.data.view.account == true ? 'selected' : 'unselected'}}"
ng-click="accountOrders()"
id="btnB">
Account Orders
</button>
And then in the Server Script, I have the following script, but the button is not hidden for anyone:
if (
gs.getUser().hasRole(''admin')
) {
accountOrders = true;
} else {
accountOrders = false;
}
ideas?
Solved! Go to Solution.
Labels:
- Labels:
-
Customer Service Management
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 10:13 AM
You can try:
<div ng-show="c.data.accountOrders">
<button
type="button"
class="btn btn-dash {{c.data.view.account == true ? 'selected' : 'unselected'}}"
ng-click="accountOrders()"
id="btnB">
Account Orders
</button>
</div>
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 10:42 AM
Are you able to post your entire server script? I think you need to attach the accountOrders to the data object. So- data.accountOrders = true;