Skip to content

How to model indirect relationship that depend on an attribute? #135

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

You must be logged in to vote

Apologies for the late response @juanjoDiaz

This can be modeled in various ways, here's one.

For the sake of brevity, we reduced the scope from the initial drive example.

model
  schema 1.1
  
type user

type folder
  relations
    define owner: [user]
    define parent: [folder]
    define parent-editor: editor from parent and can_access_children from parent
    define editor: [user] or owner or parent-editor
    define parent-viewer: viewer from parent and can_access_children from parent
    define viewer: [user] or owner or editor or parent-viewer
    define can_access_children: [user:*] or owner

Let's say you have:

  • folder:A (allows accessing children)
    • folder:AA
  • folder:B (does not …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by adriantam
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
Converted from issue

This discussion was converted from issue #134 on April 10, 2023 20:29.