Skip to content

How to model viewer from owner domain #152

Answered by rhamzeh
agale031176 asked this question in Q&A
Discussion options

You must be logged in to vote

You can do something like:

model
  schema 1.1
type user
  relations
    define domain: [domain]
    define coworker: member from domain
type domain
  relations
    define member: [user]
type board
  relations
    define owner: [user]
    define parent: [folder]
    define viewer:  [user] or owner or viewer from parent
    define can_view: viewer and coworker from owner

Make sure when a user is added to a domain that you write two tuples:

- user: user:carl
  relation: member
  object: domain:contoso
- user: domain:contoso
  relation: domain
  object: user:carl

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@agale031176
Comment options

Answer selected by agale031176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Modeling questions related to modeling
2 participants