Migrate from Oso Cloud
Map your Oso Cloud Polar policies to WorkOS FGA resource types, roles, and permissions.
This guide helps you migrate from Oso Cloud to WorkOS FGA. Oso Cloud uses the Polar language to define authorization policies with explicit fact storage. WorkOS FGA takes a different approach: hierarchical role-based access control with automatic permission inheritance configured through a Dashboard.
| Oso Cloud Concept | WorkOS FGA Equivalent |
|---|---|
resource blocks | Resource Types |
roles array | Roles |
permissions array | Permissions |
relations | Parent-child hierarchy |
has_role facts | Role Assignments |
has_relation facts | Resource registration with parent |
actor User {} | Organization Memberships |
| Local Authorization | App-side traversal (see below) |
| Polar DSL | Dashboard configuration |
Oso Cloud requires you to write Polar policies and manage facts. WorkOS FGA simplifies this:
- Permissions flow down automatically – A role at a parent level grants access to all children without additional facts
- Roles are scoped to resource types – Each resource type has its own set of roles
- Single parent per resource instance – Each resource instance has exactly one parent, creating predictable traversal paths
- No policy DSL – Configure resource types, roles, and permissions in the Dashboard
- Native WorkOS integration – Works seamlessly with AuthKit, SSO, Directory Sync, and IdP role assignment
Unlike standalone authorization systems, WorkOS FGA integrates natively with the WorkOS identity platform (although it can be used standalone):
- AuthKit Integration – Organization-scoped roles and permissions are embedded in access tokens for instant JWT-based checks
- IdP Role Assignment – Map identity provider groups (Okta, Azure AD, Google Workspace) directly to organization-scoped roles
- Directory Sync – Automatically provision and deprovision users with appropriate role assignments when group memberships change
- SSO – Enterprise SSO users get role assignments based on IdP group membership during authentication
Key patterns in Oso Polar:
roles = [...]– Define available roles on a resourcepermissions = [...]– Define available permissionsrelations = {...}– Define relationships to other resources"permission" if "role"– Grant permission to role"role" if "role"– Role inheritancerole if role on "relation"– Inherit roles from related resource
Extract resource blocks from your Polar policy. These become resource types in WorkOS FGA.
Create resource types for:
- Business containers: organizations, workspaces, projects, environments
- Shareable entities: apps, pipelines, repositories, dashboards
Exclude:
actor User {}– Use Organization Memberships as subjects insteadactor Group {}– User groups are coming soon; for now, assign roles directly to users
Map Oso relations to WorkOS FGA parent-child resource type relationships.
Create a workspace resource type with organization as its parent. Create a project resource type with workspace as its parent. The parent relationship is defined at the resource type level.
When you register individual project resources instances via the API, you specify the parent workspace. Permissions flow down this hierarchy without explicit facts.
Oso roles and permissions arrays map directly to WorkOS FGA roles and permissions.
Create roles on the project resource type:
| Role | Permissions |
|---|---|
| viewer | project:read |
| editor | project:read, project:write |
| admin | project:read, project:write, project:manage |
The role inheritance ("viewer" if "editor") becomes permissions bundled into roles. Higher-privilege roles include all permissions from lower-privilege roles.
{resource-type}:{action} for clarity. Each permission must be explicitly scoped to a resource type in the Dashboard – see more about permissions. When a role includes permissions scoped to child resource types (like project:read on a workspace role), it grants that permission on all child resources of that type.
Oso’s role if role on "relation" pattern is replaced by native hierarchical inheritance.
Create a workspace resource type with roles that include child-type permissions:
| Role (on workspace) | Permissions |
|---|---|
| viewer | workspace:read, project:read |
| editor | workspace:read, workspace:write, project:read, project:write |
When you assign workspace:viewer to a user, they automatically get project:read on all projects within that workspace. No explicit per-project facts needed.
| Oso Cloud Pattern | WorkOS FGA Equivalent |
|---|---|
"permission" if "role" | Permission included in role |
"role" if "role" | Higher role includes lower role’s permissions |
role if role on "relation" | Native inheritance (automatic) |
"permission" if "role" on "relation" | Include permission in parent role |
| Custom Polar rules | Check conditions in app code |
and expressions | Check multiple conditions in app code |
not expressions | Permission exclusions (coming soon) |
Oso’s Local Authorization generates SQL queries that you run against your database. WorkOS FGA takes a different approach: keep high-cardinality data in your database and traverse to FGA-managed resources in your application code.
Why this approach?
- Simpler architecture – No SQL generation or policy-database mapping configuration
- Clearer boundaries – FGA handles coarse-grained access, your app handles fine-grained filtering
- Better performance – Single parent traversal path, no complex joins
- No config drift – Authorization logic lives in your code, not a separate YAML file
Instead of configuring Local Authorization mappings, look up the parent resource and check access there:
This replaces Oso’s Local Authorization YAML configuration:
With this approach, traversal logic lives in your application code where it’s easier to test, debug, and version alongside your business logic.
Not everything belongs in FGA. We recommend using FGA for lower-cardinality resources (organizations, workspaces, projects) and handling high-cardinality entities (files, messages, comments) in your application.
Syncing millions of entities into FGA creates reconciliation overhead, race conditions, and consistency challenges. Instead, check access at the parent container level and filter entities in your application.
For detailed guidance on this pattern, see High-Cardinality Entities.
- Analyze Polar policy – Identify resource blocks, roles, permissions, and relations
- Define resource types in the WorkOS Dashboard matching your resources
- Define permissions for each type (e.g.,
read,write,manage) - Create roles that bundle permissions, including child-type permissions for inheritance
- Register resources via API when entities are created in your app
- Migrate facts – Convert
has_roleto role assignments,has_relationto resource registration - Replace Oso checks with WorkOS FGA
checkAPI calls - Replace Local Authorization with app-side traversal for high-cardinality entities
Resource type hierarchy:
Roles for organization:
| Role | Permissions |
|---|---|
| member | organization:read, workspace:read, project:read |
| admin | All member permissions + organization:manage, workspace:write, project:write |
Roles for workspace:
| Role | Permissions |
|---|---|
| viewer | workspace:read, project:read |
| editor | workspace:read, workspace:write, project:read, project:write |
Key insights:
role if role on "organization"– Replaced by org roles including workspace/project permissions"viewer" if "member" on "organization"– Org member role includes workspace:read- No explicit Polar rules needed – Inheritance happens automatically
- Resource Types – Design your hierarchy
- Roles and Permissions – Configure inheritance patterns
- AuthKit Integration – Embed permissions in access tokens
- IdP Role Assignment – Map IdP groups to roles
- Assignments – Migrate your facts to role assignments
- Access Checks – Replace Oso authorize calls