Created
January 17, 2024 22:38
-
-
Save francium-lupe/1c92d09ae8d0d0d517deac74300336ef to your computer and use it in GitHub Desktop.
(ReBAC) in Node.js 13
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
// Issue `tps-reports-99` belongs to repository `tps-reports` | |
await oso.tell( | |
'has_relation', // Fact type | |
{ type: 'Issue', id: 'tps-reports-99' }, // Resource | |
'repository', // Relation | |
{ type: 'Repository', id: 'tps-reports' } // Actor | |
); | |
// User `Bill` has role `admin` on repository `tps-reports` | |
await oso.tell( | |
'has_role', // Fact type | |
{ type: 'User', id: 'Bill' }, // User | |
'admin', // Role | |
{ type: 'Repository', id: 'tps-reports' } // Resource | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment