#Intersection Operation

1 messages · Page 1 of 1 (latest)

meager chasm
#

Hi @worn sequoia Does following schema achives what you need:

entity user {}

entity organization {
  relation member @user
}

entity document {
  // represents documents parent organization
  relation parent @organization
  // permissions
  action view = parent.member
}

In this model:

  • The organization entity has a member relationship that includes users.
  • The document entity has a parent relationship pointing to its owning organization.
  • The view action (or permission) on a document is granted if the user requesting access is a member of the document's parent organization.
worn sequoia
#

thanks @meager chasm . the user needs to match ALL orgs the doc has.