Polar language preview
1. Allow rule
typed actors and has_permission
horizon-dark
allow(actor: User, "read", resource: Document) if
has_permission(actor, "read", resource); atom-one-dark
allow(actor: User, "read", resource: Document) if
has_permission(actor, "read", resource); github-dark
allow(actor: User, "read", resource: Document) if
has_permission(actor, "read", resource); dracula
allow(actor: User, "read", resource: Document) if
has_permission(actor, "read", resource); nord
allow(actor: User, "read", resource: Document) if
has_permission(actor, "read", resource); github
allow(actor: User, "read", resource: Document) if
has_permission(actor, "read", resource); 2. Resource block
permissions and nested relations
horizon-dark
resource Repository {
permissions = ["read", "push"];
relations = { parent: Organization };
"read" if "member";
} atom-one-dark
resource Repository {
permissions = ["read", "push"];
relations = { parent: Organization };
"read" if "member";
} github-dark
resource Repository {
permissions = ["read", "push"];
relations = { parent: Organization };
"read" if "member";
} dracula
resource Repository {
permissions = ["read", "push"];
relations = { parent: Organization };
"read" if "member";
} nord
resource Repository {
permissions = ["read", "push"];
relations = { parent: Organization };
"read" if "member";
} github
resource Repository {
permissions = ["read", "push"];
relations = { parent: Organization };
"read" if "member";
} 3. Actor and comments
hash comments and actor blocks
horizon-dark
# who can act
actor User {}
allow(user: User, "read", repo: Repository) if
has_role(user, "member", repo); atom-one-dark
# who can act
actor User {}
allow(user: User, "read", repo: Repository) if
has_role(user, "member", repo); github-dark
# who can act
actor User {}
allow(user: User, "read", repo: Repository) if
has_role(user, "member", repo); dracula
# who can act
actor User {}
allow(user: User, "read", repo: Repository) if
has_role(user, "member", repo); nord
# who can act
actor User {}
allow(user: User, "read", repo: Repository) if
has_role(user, "member", repo); github
# who can act
actor User {}
allow(user: User, "read", repo: Repository) if
has_role(user, "member", repo);