- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2025 03:47 PM
Hi Everyone,
I'm working in the ServiceNow Xanadu Build, customizing the Project Workspace (SPM) Experience. Specifically, I need to restrict visibility of the Resource Assignment Toggle in the planning workspace.
My Goal:
Only users with either the it_pps_admin or our new resource_user_pilot roles should see the Resource Assignment Toggle/Button in the Planning view.
What I've tried so Far:
Client Scripts that set state.showResourceToggle based on user roles and bind that to the toggle's "Hide component" property.
DOM manipulation (e.g., using queryselector to hide the toggle after page load).
Modify classicConsoleURLsJSON output in an onDataChanged script to filter out the resource pane.
UI Scripts with role checks, g_user.hasrole, etc.
Despite these, the toggle still renders or fails to bind properly in the UI Builder.
What I need to know:
Is there a supported way to control visibility of the Resource Assignment Toggle (or Pane) in the Project Workspace using role-based logic?
Can the Planning UX Page or its macroponent be overridden cleanly?
Has anyone successfully scoped visibility for that toggle using macroponent overrides, UI Builder conditionals, or a clean UXF pattern?
Appreciate any guidance or best practices! I want to do this the right way, not with a fragile DOM patch.
Thanks,
Devon Patterson
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 06:21 AM
Hi @dpattersonryder ,
In the script include "ProjectWorkspaceConfig" there is a function getConfig, which return the Config properties for PW.
you can modify the property value isRPEnabled: ProjectWorkspaceUtil.isResourcePlanningEnabled() to
isRPEnabled: ProjectWorkspaceUtil.isResourcePlanningEnabled() && (gs.hasRole("ROLE_NAME")),
This way you can control the access without modifying the UI builder elements.
If this helps, please mark my answer as Accepted solution.
Hope it helps!
Nootan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 01:22 AM
Please try the following script.
function evaluateProperty({api, helpers}) {
const roles = api.context.session.user.roles;
return !(roles.includes('it_pps_admin') || roles.includes('resource_user_pilot'));
}
If the panel is displayed, you also need to add a condition to "Displays Resource Panel".
The client state parameter "isResourcePlanOn" is saved in sys_user_preference when you toggle it on/off. (sn_pw_display_resource_panel)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 06:29 AM
Thank you, I will give this a shot today. I will let you know.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 06:21 AM
Hi @dpattersonryder ,
In the script include "ProjectWorkspaceConfig" there is a function getConfig, which return the Config properties for PW.
you can modify the property value isRPEnabled: ProjectWorkspaceUtil.isResourcePlanningEnabled() to
isRPEnabled: ProjectWorkspaceUtil.isResourcePlanningEnabled() && (gs.hasRole("ROLE_NAME")),
This way you can control the access without modifying the UI builder elements.
If this helps, please mark my answer as Accepted solution.
Hope it helps!
Nootan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 09:47 AM
This was the fastest way to get this done and it completely works. The only thing I changed to the code was:
isRPEnabled: ProjectWorkspaceUtil.isResourcePlanningEnabled() &&
(gs.hasRole("resource_user_pilot") || gs.hasRole("resource_manager_pilot") || gs.hasRole("it_pps_admin")),
Which made it work flawless. Thank you!