Hi! I have a simple schema with fleets, organizati...
# spicedb
s
Hi! I have a simple schema with fleets, organizations and users. The fleets are owned by a user, and can be accessed by users of an organization. The users are either members of an organization, or others users of the system. It's possible to have view/read access to the user if an org is on their allowlist. Example:
Copy code
definition user {
    relation allowed_organizations: organization

    permission view = allowed_organizations->view
}

definition organization {
    relation viewer: user

    permission view = viewer
}

definition fleet {
    relation owner: user
    relation allowed_organizations: organization

    permission view = owner + allowed_organizations->view
}
Now I'd like to also 'automatically' grant access ti the fleet owner to any organization on the allowed_organizations list. Is it possible to do this without adding a new relation to the user? Such as:
Copy code
definition user {
    relation allowed_organizations: organization
    relation owned_fleets: fleet

    permission view = allowed_organizations->view + owned_fleets->view
}

definition organization {
    relation viewer: user

    permission view = viewer
}

definition fleet {
    relation owner: user
    relation allowed_organizations: organization

    permission view = owner + allowed_organizations->view
}