Send Data to Oso Cloud as Context Facts
For Oso to make authorization decisions, it requires data from your application. Oso accepts data as facts — a lightweight format that complements logic written in Polar. You send facts to Oso Cloud along with an authorization request. Facts sent to Oso Cloud with this method are context facts. The syntax depends on which client SDK you use. In the TypeScript SDK, context facts are passed as an optional 4th argument to theoso.authorize
call.
src/authz.ts
- A fact declaring the relationship between the
Repository
and its parentOrganization
- [Optional] A fact declaring the
User
’s role in theOrganization
- [Optional] A fact declaring the
User
’s role on theRepository
.authorize()
.