Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to Restrict "View Workbench" UI Action to Specific Roles in Major Incident Management?

sattar3
Tera Contributor

Hello Everyone,

I am looking to hide the "View Workbench" UI action, which currently appears for proposed or promoted Major Incidents.

 My requirement is to implement role-based access control for the Major Incident Management (MIM) Workbench. Specifically, I want only authorized users with certain roles to access and perform critical actions related to Major Incident Management.

Roles and Access Requirements:

We plan to define the following roles with specific permissions:

  • Major Incident Manager (Major Incident Manager)
    • Full access to declare major incidents, manage the workbench, and coordinate resolutions.
  • Communication Manager
  • Incident Manager
  • Admin

The roles should have permissions organized around:

  • Incident declaration
  • Workbench access
  • Communication plan management
  • Task assignments and updates

Current Setup:

  • The Major Incident Management plugin is installed.
  • The "View Workbench" UI action is currently visible regardless of user role.

What I Need Help With:

  • How can I restrict the visibility of the "View Workbench" UI action so that only users with one of the following roles can see it?

    • major_incident_manager
    • communication_manager
    • incident_manager
    • admin
  • Are there best practices or recommended approaches to implement this kind of role-based UI action visibility within the Major Incident Management plugin?

Any sample scripts, configuration guidance, or suggestions would be greatly appreciated!

 

Thanks,

Sattar

3 REPLIES 3

RaghavSh
Mega Patron

@sattar3 Open "View Workbench" UI action in "sys_ui_action" table and under "Requires Role" tab add the roles required to access this button.

I don't think any script is required here.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn

Shruti
Mega Sage
Mega Sage

Hi

Open the "View Workbench"  UI action and Add roles to it

Shruti_0-1764575189576.png

 

aakankshapl
Tera Guru

Hello @sattar3 

Try adding condition in the Ui action, like below

gs.hasRole("major_incident_manager")) || gs.hasRole("communication_manager")) || gs.hasRole("incident_manager")) || gs.hasRole("admin")) 

aakankshapl_0-1764575445534.png

 

 

💡Please mark my answer correct and helpful if this works for you ✔️

Thanks and Regards,
Aakanksha