One-to-many: two level nesting composite structure problems

Good day
I am new to cuba studio. I created a one to many - two level Nesting composite structure between tables: Project - Task - SubTask in that order. I as well created users with specific roles to what they can do on the application, either log in as project supervisor, task performer or subtask performer.
I as well used access groups to users to see only thier projects. Project Supervisor can only see projects she/he created(This works fine), Task performer can only see projects where she/he appears(This works fine), and SubTask performer should only see projects where she/he appears(I cannot figure out a way to implement this constraint in the access group of SubTask table).

Please help with this problem.
Regards

Hi,

You need a subselect in the third constraint.
Below are the constraints that, as far as I see, you are looking for:

  1. Project Supervisor access group
    Where Clause: {E}.createdBy = :session$userLogin

  2. Task Performer access group
    Join Clause: join {E}.tasks t
    Where Clause: t.assignee.id = :session$userId

  3. SubTask Performer access group
    Join Clause: join {E}.tasks t
    Where Clause: t.subtasks in (select s from demo$SubTask s where s.assignee.id = :session$userId)

I’ve attached a sample project with these constraints working:
demo.zip (112.1 KB)