Vinny A
12/02/2022, 9:20 PMJoey
12/02/2022, 9:24 PMVinny A
12/02/2022, 9:35 PMromil
12/05/2022, 5:40 AMJoey
12/05/2022, 6:28 AMJoey
12/05/2022, 6:28 AMJoey
12/05/2022, 6:29 AMJoey
12/05/2022, 6:30 AMcostap
12/05/2022, 11:16 AMLarsRan
12/05/2022, 1:41 PMdefinition user {}
definition folder {
relation reader: user
permission read = reader
}
definition document {
relation parent: folder
permission read = parent->read
}
lets say that I want users to have read
permissions whenever a document does not have a parent_folder. What would be a nice way to go about this? I guess this is another instance where the intersection arrow would come in handy.
A possible solution could be:
definition user {}
definition folder {
relation reader: user
permission read = reader
}
definition document {
relation parent: folder | folderless
permission read = parent->read
}
definition folderless {
relation reader: user:*
permission read = reader
}
but it feels a bit off, since there is no way to guarantee folder and folderless are mutually exclusive. Does anyone have some tips or ideas on how to solve this?dsieczko
12/05/2022, 2:07 PMLarsRan
12/05/2022, 2:27 PMdefinition user {}
definition folder {
relation all: user:*
relation reader: user
permission not_read = all - reader
}
definition document {
relation all: user:*
relation parent: folder
permission read = all - parent->not_reader
}
This would give me what I want (if a document can have at most one parent). But it still feels a bit offLarsRan
12/05/2022, 2:27 PMLarsRan
12/05/2022, 2:28 PMdsieczko
12/05/2022, 2:31 PMdefinition user {}
definition organization {
relation member: user
permission view_all_contracts = member
}
definition contract {
relation owner: organization
permission view = organization->view_all_contracts
}
dsieczko
12/05/2022, 2:44 PMdsieczko
12/05/2022, 2:45 PMJake
12/05/2022, 2:51 PMLarsRan
12/05/2022, 2:52 PMromil
12/05/2022, 3:33 PMromil
12/05/2022, 3:39 PMJoey
12/05/2022, 3:41 PMPerseus
12/06/2022, 6:26 AMdata
theregvf
12/06/2022, 8:22 AMwilliamdclt
12/06/2022, 12:44 PMwilliamdclt
12/06/2022, 12:47 PMAlsbury
12/06/2022, 3:10 PMensonic
12/06/2022, 3:21 PMJoey
12/06/2022, 3:33 PMJoey
12/06/2022, 3:34 PMwrite_title
, read_intro
, etc? or can they be more dynamic?