Restrict Project form editing depending the assignment group selected

RamVal
Tera Expert

Hi Everyone,

     I need help with this topic. The requirement is about restricting the edition of the Project form when a Group is assigned.

We have a group called BU Department, an inside this group we have BU Leaders y BU users. In BU Leaders we have thee Project Manager Leader, and in BU users we have group of Project Managers that are part of this department.

 

The complexity is that the group we assign in "Assignment group field" is BU Department. In other words,  I need an script that analyze the field (the assignement group) and grants "edit" permissions to those who are part of the group BU Leaders only. The BU user will have edit permission only when he is assigned as a Project Manager in the field "Project Manager". This last part i got it, but i need help for the first(BU Leaders). 

  var pmoLeaders = new GlideRecord('sys_user_grmember'); 

      pmoLeaders.addQuery('group', pm_project.assignment_group); 

      pmoLeaders.addQuery('user', gs.getUserID()); 

      pmoLeaders.query(); 

 

      if (pmoLeaders.hasNext()) { 

        

        answer=true; 

      } 

 

This script only analyze the current assigned group, if we assign BU Leaders as a group it would works. But we assign department, so why I have to modify it. 


1 ACCEPTED SOLUTION

RamVal
Tera Expert

A better solution found was using ACLs, Operation: write, Roles, and conditioning them with: Assignment group is (dynamic) One of my Groups.

View solution in original post

1 REPLY 1

RamVal
Tera Expert

A better solution found was using ACLs, Operation: write, Roles, and conditioning them with: Assignment group is (dynamic) One of my Groups.