-
-
Save hwayne/ad1b61fec519142a890a4f6608ea6a97 to your computer and use it in GitHub Desktop.
PLTalk Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sig User {} | |
sig Resource { | |
, allow: set User | |
, parent: lone Resource | |
} | |
fact "No resource can be its own ancestor" { | |
no iden & ^parent | |
} | |
assert parent_implies_child { | |
-- if you can access a parent, you can access its child | |
all u: User, r: Resource | | |
u.can_access[r] => | |
all c: r.~parent | | |
u.can_access[c] | |
} | |
pred can_access[u: User, r: Resource] { | |
u in r.allow or u in r.^parent.allow | |
} | |
check parent_implies_child |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment