WorkOS Docs Homepage
RBAC
API referenceDashboardSign In
OverviewOverviewConfigurationConfigurationIntegrationIntegrationOrganization RolesOrganization RolesIdP Role AssignmentIdP Role Assignment
API Reference
API Reference
Events
Events
Integrations
Integrations
Migrate to WorkOS
Migrate to WorkOS
SDKs
SDKs

Quick Start

Set up roles & permissions to model your authorization requirements. Then use the SDK to make access checks from your application.

On this page

  • Before getting started
  • What you’ll build
  • API resource definitions
  • 1. Create roles
  • 2. Create permissions
  • Summary

Before getting started

To get the most out of this guide, you should have:

  • A WorkOS account
  • Your WorkOS API Key

What you’ll build

In this guide, we’ll implement role-based access control for a simple B2B video sharing SaaS application, where users can view and create videos, and elevated roles can manage other users’ roles and application settings.

We will:

  1. Map your application’s access management model to a set of roles
  2. Define permissions to control granular access to your application’s resources
  3. Associate permissions with roles, and configure default roles and priority order
  4. If using AuthKit, assign roles to organization memberships and determine access via the session JWT
  5. If using standalone SSO, access user roles through the SSO Profile object
  6. If using standalone Directory Sync, access user roles through the Directory User object

API resource definitions

Role
Represents a logical grouping of access management rules.

1. Create roles

The first step to RBAC is to determine the application’s access management hierarchy.

2. Create permissions

The first step to RBAC is to define

Get provider-specific instructions by selecting the directory provider you want to test:

Summary

That’s it! We’ve now setup a powerful RBAC system for our application.

© WorkOS, Inc.
FeaturesAuthKitSingle Sign-OnDirectory SyncAdmin PortalFine-Grained Authorization
DevelopersDocumentationChangelogAPI Status
ResourcesBlogPodcastPricingSecuritySupport
CompanyAboutCustomersCareersLegalPrivacy
© WorkOS, Inc.