Skip to content

Instantly share code, notes, and snippets.

@francium-lupe
Created January 17, 2024 22:38
Show Gist options
  • Save francium-lupe/1c92d09ae8d0d0d517deac74300336ef to your computer and use it in GitHub Desktop.
Save francium-lupe/1c92d09ae8d0d0d517deac74300336ef to your computer and use it in GitHub Desktop.
(ReBAC) in Node.js 13
// 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