Need to give access to all of the childs of a project

Naman10
Tera Contributor

I have a query business rule to provide access to user according to some conditions mentioned below:

 record.assigned_to == ME

 OR record.assigment_group == ME

 OR record.additional_assignee_list == ME

 OR record.parent_record.project_manager == ME

 OR record.parent_record.assigned_to == ME

 OR record.parent_record.additional_assignee_list has ME

 OR user has "it_portfolio_manager"role

 OR user isMemberOf "BCM group"

 OR user is part of record.parent_record.assignment_group

 

PROJECT -> PROJECT_TASK(1) -> PROJECT_TASK(2)

PROJECT is the main parent which has PROJECT_TASK(1) as child and PROJECT_TASK(1) further have a child PROJECT_TASK(2).

Query BR:

(function executeRule(current, previous /*null when async*/ ) {

    if (gs.hasRole('project_user')) {

        current.addEncodedQuery("assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^OR" + "assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^OR" + "additional_assignee_listDYNAMIC90d1921e5f510100a9ad2572f2b477fe^OR" + "parent.ref_pm_project.project_managerDYNAMIC90d1921e5f510100a9ad2572f2b477fe^OR" +

            "parent.assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^OR" +

            "parent.additional_assignee_listDYNAMIC90d1921e5f510100a9ad2572f2b477fe^OR" + "parent.assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744");

    }

})(current, previous);

 

CURRENT SITUATION:

From PROJECT_TASK(2) it is checking the parent which is PROJECT_TASK(1) and if the user is not fulfilling the above conditions so it id not showing the PROJECT_TASK(2) which is the last child to PROJECT.

 

DESIRED SITUATION:

If the user is fulfilling the conditions mentioned in the query business rule for PROJECT it should get the access to all of the childs for PROJECT.

 

Currently it is only checking for one level but PROJECT_TASK could have multiple child tasks which is not possible with the current BR.

 

Thanks in advance

Naman Punia

1 REPLY 1

Naman10
Tera Contributor

Hi Team,

 

can anyone please help me out in this?

 

Regards,

Naman