- Configuring and Extending Benefits
- Hide Buttons for People with a Specific Role
Hide Buttons for People with a Specific Role
To let some benefits administrators only view a page, you can hide the buttons from them. You can also hide the buttons on some section headers of a page and leave them on other section headers.
Before you start
- Create a custom job role.
- Create a data role for the new job role.
- Attach the new data role to the person you'll be signing in as.
- Sign in as the person with the new data role.
- Create a Sandbox and Make It Active
Here's what to do
- Go to Navigator > Configuration > Sandboxes.
- Enter your sandbox.
- Go to and open the page with the buttons you want to hide. For example, you go to the Benefits Summary page to hide the +Add button on the Potential Life Events section.
- On the Settings and Actions menu, click Edit Pages.
- Confirm that the edit page header has Edit Layer: Site - SITE.
- On the View menu, select Source.
-
Hide a button.
- On the Structure tab, click the button you want to hide, such as the +Add button on the Potential Life Events section header.
- On the Confirm Shared Component Edit dialog box, click Edit.
- On the Source pane toolbar, click the Show the properties of... icon, such as Show the properties of Add.
- On the Component Properties dialog box, in the Show Component field, select Expression Builder.
- On the Expression Editor dialog box, in the Type a value or
expression field, append the expression to hide the
button from people with the specified role. Here's the expression that
hides the button from people with the
SS_BEN_BENEFITS_ADMINISTRATOR_JOB role.
!securityContext.userInRole['SS_BEN_BENEFITS_ADMINISTRATOR_JOB']
Here's an example of what the complete expression would be to hide the +Add button on the Potential Life Events section header of the Benefits Summary page:
#{bindings.BenefitRelSystemCd=='BEN_OAB' and | !securityContext.userInRole['SS_BEN_BENEFITS_ADMINISTRATOR_JOB']
- Click OK.
- On the Component Properties dialog box, click Apply.
- Click OK.
-
Optionally remove extra space under the section header that you removed the
button from, for the same set of benefits administrators.
- On the Structure tab, click the space you want to hide, such as the space below the Potential Life Events section header on the Benefits Summary page.
- On the Confirm Shared Component Edit dialog box, click Edit.
- On the Source pane toolbar, click the Show the properties of... icon, such as Show the properties of toolbar.
- On the Component Properties dialog box, in the Show Component field, select Expression Builder.
- On the Expression Editor dialog box, in the Type a value or expression field, append the same expression you used to hide the button.
- Click OK.
- On the Component Properties dialog box, click Apply.
- Click OK.
-
Optionally remove the line separator below the section header that you removed
the button from, for the same set of benefits administrators.
- On the Structure tab, click the line separator you want to hide, such as the line below the Potential Life Events section header on the Benefits Summary page.
- On the Confirm Shared Component Edit dialog box, click Edit.
- On the Source pane toolbar, click the Show the properties of... icon, such as Show the properties of separator.
- On the Component Properties dialog box, in the Show Component field, select Expression Builder.
- On the Expression Editor dialog box, in the Type a value or expression field, append the same expression you used to hide the button.
- Click OK.
- On the Component Properties dialog box, click Apply.
- Click OK.
- To render your changes, on the page, click Close.
- To verify your changes, on the Sandbox Mode: Edit menu, select Preview as if Published (Context: All).
- To publish your changes, on the <YourSandboxName> menu, select Publish.