Last active
August 29, 2023 13:57
-
-
Save francium-lupe/cabe63384d0c552a00138208a53d494b to your computer and use it in GitHub Desktop.
Polar 2
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
actor User {} | |
resource Vehicle { | |
permissions = ["security", "update", "updateAuthorizedUsers"]; | |
roles = ["admin", "manager", "booked-user"]; | |
"security" if "booked-user"; | |
"update" if "manager"; | |
"updateAuthorizedUsers" if "admin"; | |
"manager" if "admin"; | |
"booked-user" if "manager"; | |
} | |
has_role(actor: User, "admin", _vehicle: Vehicle) if | |
role in actor.roles and | |
"admin" = role.name; | |
has_role(actor: User, role_name: String, vehicle: Vehicle) if | |
role in actor.roles and | |
role_name = role.name and | |
vehicle = role.resource; | |
allow(actor, action, resource) if | |
has_permission(actor, action, resource); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment