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:

  1. Policy Examples: These feature policy code along with test scripts that can be used to evaluate the policy.
  2. Example Apps: These are language specific examples built using Oso Cloud for authorization enforcement.

Policy Examples

TutorialCode ExampleMaturity LevelDescriptionPrerequisites
Writing Your First Policycode (opens in a new tab)Application-wide Authorization
Use Oso Cloud to create an authorization model for a multi-tenancy application.None
Using Attributes to Control Permissionscode (opens in a new tab)Resource-specific Authorization
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

TutorialCode ExampleMaturity LevelDescriptionPrerequisites
Git Cloud: End-to-End Examplecode (opens in a new tab)
(Typescript, Python)
Resource-specific Authorization
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.

Get started with Oso Cloud →