How to give project_user (role) user access to write in projects tasks where he/she is the PM of the parent project?

skendy
Tera Expert

Hi,

I have been thinking how to let users with project_user role to have write acl on the table pm_project_task ONLY if he is the project_manager (field) of the parent project (pm_project).

I grant write to the role with a condition where (dot walking) .u_ref_proj.project_manager is (dynamic) me, but then all project tasks fields become Read Only.

u_ref_proj is a project task field which references to project table.

I have been trying to add the following script (suggested by other in the community) instead of the control but nothing changes:

It is weird because I applied the same script for omitting the New button (thanks to Anurag) from the list and it worked (changing the true/false for the answer)...

var utente=gs.getUserID();

if (parent.project_manager==utente)             //since we have a relationship/related list between the two tables

      answer=true;

else

      answer=false;

I would appreciate any comment!

Thanks,

Skender

1 ACCEPTED SOLUTION

just write the code that when a new task is added , the project number is filled in u_ref_proj.


And on the projet form use the "-> parent" related list.


This will fix all your troubles.


-Anurag

View solution in original post

19 REPLIES 19

skendy
Tera Expert

I think there is a conflict:


I see two related lists under project form.



- pm_project_task.parent


- pm_project_task.u_ref_proj



The second is the u_ref_proj which refers to the pm_project table.


Maybe the real problem is:


how to pass (a kind of relation so I can retrieve parent's field from dot walking...) from the fields of pm_project_task to the fields of pm_project?


There will not be a conflict. this is actually one of the ways to relate 2 tables in service now (creation of reference fields).


Since you created a custom field u_ref_proj so a new related list is also available for you.


-Anurag

Ok I get it, but where do I create project tasks? In which related list?


I do not want to make damage to the system...



Thanks,


Skender