yeah, i suppose it could look something like this:...
# spicedb
u
yeah, i suppose it could look something like this:
Copy code
definition organization {
    relation manager: user
    relation child: checklist
    permission read = manager | child->read
}

definition checklist {
    relation parent: organization
    relation child: task
    permission read = parent->read | child->read
}

definition task {
    relation parent: checklist
    relation assignee: user
    permission read = assignee + parent->read
}
Relationships:
Copy code
// When creating the checklist and the task
checklist:checklist-1#parent@organization:org-1
task:task-1#parent@checklist:checklist-1
checklist:checklist-1#child@task:task-1
organization:org-1#child@checklist:checklist-1

// When adding an organization manager
organization:org-1#manager@user:manager-1

// When adding an assignee to a task
task-1#assignee@user:assignee-1
I guess that would work but definitely seems like it requires several duplicated relationships to be set up beforehand
2 Views