Hello. given this schema: ``` definition user {} ...
# spicedb
s
Hello. given this schema:
Copy code
definition user {}

definition child {
    relation child_viewer: user

    permission view_child = child_viewer
}

definition parent {
    relation entity: child

    permission view_parent = entity->view_child
}
is there any way to allow the
view_parent
permission only if the user has the
view_child
permission for all the
entity
children relation created for the parent? So if the parent has 2 child
entity
relations, for the user to have the
view_parent
permission, it has to also have the
view_child
permission on those 2 children. Currently with the schema like this, if the user has the
view_child
permission for one child of the parent but not the other child, the user still gets the
view_parent
permission. Is there some kind of schema like this that will check all child relationships before allowing the permission on the parent:
Copy code
permission view_parent = entity:*->view_child
Note the
:*
on the
entitiy
to denote all entity relations on the parent should satisfy this