stanfyr
11/14/2025, 1:43 PMyetitwo
11/14/2025, 2:33 PMstanfyr
11/14/2025, 3:12 PMzed
definition user {}
definition workspace {
relation admin: user
relation member: user
permission read = write + member
permission write = admin
}
definition picture {
relation owner: workspace
permission read = write + owner->read
permission write = owner->write
}
and this caveat :
zed
caveat mfa_match(expected_amr string, provided_amr list<any>) {
size(provided_amr) > 0 && expected in provided_amr
}
now, the admin has the right to make any resource require mfa to access.
one way to make that is to add the caveat to relations admin and member and then edit all of these relations to redefine them with the context {"expected":"mfa"}
then all checks would provide the context. eg. {"provided_amr":["mfa", "otp"]}
that implies that all relations with the users need to bear the caveat mfa_match and context {"expected":"mfa"}
I am simply looking for a way to make the workspace itself somehow bearing this information, to avoid having to update all user relations on every checks.stanfyr
11/14/2025, 3:12 PMyetitwo
11/14/2025, 3:56 PMdefinition mfa_guard {} or something equivalent that sits between the user and the workspaceyetitwo
11/14/2025, 3:56 PMmfa_guard and the workspace, and then users are connected to the mfa_guard rather than the workspaceyetitwo
11/14/2025, 4:01 PMyetitwo
11/14/2025, 4:01 PMyetitwo
11/14/2025, 4:02 PMdefinition workspace {
relation mfa_guard: workspace with mfa_match
relation admin: user
relation member: user
permission read = mfa_guard->write + mfa_guard->member
permission write = mfa_guard->admin
}yetitwo
11/14/2025, 4:03 PMworkspace:someworkspace#mfa_guard@workspace:someworkspace{provided_amr:[1,2,3]} (or whatever that syntax would be)Joey
11/14/2025, 4:10 PMstanfyr
11/14/2025, 5:35 PMstanfyr
11/14/2025, 5:36 PMyetitwo
11/14/2025, 5:37 PMself keyword, but rather a relation that points from a definition to itself and from an object to itselfstanfyr
11/14/2025, 5:37 PMyetitwo
11/14/2025, 5:38 PMself keywordstanfyr
11/14/2025, 5:38 PMstanfyr
11/14/2025, 5:38 PMyetitwo
11/14/2025, 6:29 PMyetitwo
11/14/2025, 6:29 PMstanfyr
11/14/2025, 7:14 PMstanfyr
11/14/2025, 8:20 PMJoey
11/15/2025, 1:45 AMstanfyr
11/17/2025, 8:29 AM