Code Examples
Throughout the docs you'll see several code examples related to policy code or application code. Here, we've provided a table with links to repositories where some of those code examples live. There you can explore and run the examples in their full context. Currently there are two categories of code examples:
- Policy Examples: These feature policy code along with test scripts that can be used to evaluate the policy.
- Example Apps: These are language specific examples built using Oso Cloud for authorization enforcement.
Policy Examples
Tutorial | Code Example | Maturity Level | Description | Prerequisites |
---|---|---|---|---|
Writing Your First Policy | code (opens in a new tab) | Application-wide Authorization Beginner | Use Oso Cloud to create an authorization model for a multi-tenancy application. | None |
Using Attributes to Control Permissions | code (opens in a new tab) | Resource-specific Authorization Intermediate | Model aspects of a credit card app (accounts, transaction limits, rewards program, ect.) using permissions, attributes, and context facts). | • Patterns in Relationship Based Access Control • Patterns in Attribute Based Access Control |
Example Apps
Tutorial | Code Example | Maturity Level | Description | Prerequisites |
---|---|---|---|---|
Git Cloud: End-to-End Example | code (opens in a new tab) (Typescript, Python) | Resource-specific Authorization Intermediate | Use Oso Cloud to enforce authorization in a real world application. | None |
Talk to an Oso Engineer
If you'd like to learn more about using Oso Cloud in your app or have any questions about this guide, connect with us on Slack. We're happy to help.