Resource Management Workspace - Unassigned tasks actions. How to handle visibility?

Gaspar Fiks
Tera Expert

Hi Community! 

I was wondering if anyone can help me find where is the logic behind the actions on the unassigned tasks on the Resource Management Workspace: 

GasparFiks_0-1764251258882.png

 

I need to restrict the "Assign work" action to only be visible for RESOURCE MANAGERS and not project managers. 

 

Thank you very much ! 

 

1 ACCEPTED SOLUTION

Patricia9
Tera Guru

Hello Gaspar, 

 

You can use ACLs to restrict this access. However, ACLs are not currently working on the Resource Management Workspace.

You can do the following:

  1. Create ACLs and review if the behaviour is working as you need in the classic view.
  2. Activate ACLs in the Resource Management Workspace.
    a.Modify the function "getAssignmentData" of "RMWorkspaceDataFetchSNC" script. After the block of code to set the variable "row._metadata …" (line 194-205), you can add something like this:
     
/* If  Resource Manager can only update the status of the RA, then you can use this to restrict the Assign work button */
row._metadata.canAssignWork = true;

if (!asmtGr.resource_status.canWrite()) { // This checks the ACLs
         row._metadata.canAssignWork = false;
}​

or another example which uses roles:

row._metadata.canAssignWork = true;

if (!gs.hasRole('resource_manager')) {
         row._metadata.canAssignWork = false;
}

 

b.You will also need to customise the function "_getBottomGridRowActions" of the script  "RMWorkspaceServiceSNC". Add the criteria in the assign work button:

if(canWrite && canCreate) {
bottomGridRowActions.push(
{
"actionName": "assign_work",
"id": "assign_work",
"label": gs.getMessage("Assign work"),
"name": gs.getMessage("Assign work"),
"criteria": '_metadata.canAssignWork=true'
}
);
}

 

To customise these functions you have to use the scripts RMWorkspaceDataFetch and RMWorkspaceService.

View solution in original post

3 REPLIES 3

Patricia9
Tera Guru

Hello Gaspar, 

 

You can use ACLs to restrict this access. However, ACLs are not currently working on the Resource Management Workspace.

You can do the following:

  1. Create ACLs and review if the behaviour is working as you need in the classic view.
  2. Activate ACLs in the Resource Management Workspace.
    a.Modify the function "getAssignmentData" of "RMWorkspaceDataFetchSNC" script. After the block of code to set the variable "row._metadata …" (line 194-205), you can add something like this:
     
/* If  Resource Manager can only update the status of the RA, then you can use this to restrict the Assign work button */
row._metadata.canAssignWork = true;

if (!asmtGr.resource_status.canWrite()) { // This checks the ACLs
         row._metadata.canAssignWork = false;
}​

or another example which uses roles:

row._metadata.canAssignWork = true;

if (!gs.hasRole('resource_manager')) {
         row._metadata.canAssignWork = false;
}

 

b.You will also need to customise the function "_getBottomGridRowActions" of the script  "RMWorkspaceServiceSNC". Add the criteria in the assign work button:

if(canWrite && canCreate) {
bottomGridRowActions.push(
{
"actionName": "assign_work",
"id": "assign_work",
"label": gs.getMessage("Assign work"),
"name": gs.getMessage("Assign work"),
"criteria": '_metadata.canAssignWork=true'
}
);
}

 

To customise these functions you have to use the scripts RMWorkspaceDataFetch and RMWorkspaceService.

Once again THANK YOU @Patricia9 !!! This was a GREAT help!! Thank youuuuu!!!

Arnab19
ServiceNow Employee
ServiceNow Employee

Hi,
Field level ACLs will work from Q4'2025 release.