Skip to content

Instantly share code, notes, and snippets.

@francium-lupe
Created January 17, 2024 22:38
Show Gist options
  • Save francium-lupe/d90ced2c11df3c2af1bab4df114e659b to your computer and use it in GitHub Desktop.
Save francium-lupe/d90ced2c11df3c2af1bab4df114e659b to your computer and use it in GitHub Desktop.
(ReBAC) in Node.js 12
resource Issue {
# Permissions
permissions = ["edit"];
# Roles
roles = ["editor"];
# UPDATED: added repository Relation
relations = { creator: User, repository: Repository };
# Any user with the "editor" role can "edit"
"edit" if "editor";
# User who created this issue has "editor" role
"editor" if "creator";
# UPDATED: admins on repository have "editor" role
"editor" if "admin" on "repository";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment