Authaz logoAuthaz
DocumentationAPI Reference
  • Get Started

    • Authaz
    • Core Concepts
    • Set up your app
    • Quickstart — cURL
  • Authentication

    • Authentication Settings
    • Signup
    • Invitations
    • Password Authentication
    • Multi-Factor Auth
    • Magic Link
    • OAuth / Social Login
    • Passkey (WebAuthn)
    • SAML SSO
    • Machine-to-Machine (M2M)
    • API Keys
  • Authorization

    • Authorization
    • Resources
    • Policies
    • Roles
    • Access Explorer
  • Tenancy

    • Multi-tenancy
    • Tenancy Customization
  • Brand & Host

    • Branding
    • Custom Domains
    • Communications & Email Templates
  • Operate

    • Users
    • Analytics
    • Audit Logs
    • Application Settings
  • SDK Quickstarts

    • Quickstart — Next.js
    • Quickstart — React SPA
    • Quickstart — Hono
    • Quickstart — .NET (Authaz.Sdk)
  • Recipes

    • Recipes & Cookbook
    • Next.js — first integration
    • Next.js — B2B SaaS (multi-tenant)
    • Hono — first integration
    • Hono — B2B SaaS (multi-tenant)
    • React SPA — first integration
    • React SPA — B2B SaaS (multi-tenant)
    • .NET — first integration
    • .NET — B2B SaaS (multi-tenant)
  • Reference

    • Tokens
    • API Reference
    • Errors & Troubleshooting
  • Documentation

    • How Authaz is Built
  1. Authaz
  2. Docs
  3. Authorization
  4. Roles

Authorization

Roles

3 min read·Updated Jun 19, 2026

The Roles page (under Authorization → Manage) is where you compose what users (and credentials, and API keys) can do. The dashboard groups roles into Global (apply across every tenant in this application) and Tenant (scoped to a specific tenant). Click a role to edit its policies, assignees, and recent activity.

# Create a role
curl -X POST https://your-app.authaz.io/api/v1/applications/{appId}/roles \
  -H "X-API-Key: $AUTHAZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Member",
    "description": "Can manage invoices and view reports.",
    "policyIds": ["pol_invoices_writer", "pol_reports_viewer"]
  }'

What's in a role#

A role is a thin wrapper:

  • name and description — what users see in the dashboard.
  • policyIds — the reusable policies attached. Permissions come from these.
Previous
Policies
Next
Access Explorer
  • tenantId (optional) — when set, the role only applies inside that tenant.
  • userCount — how many users are currently assigned the role.
  • Roles don't carry permissions directly — that's policies' job. Two reasons: it makes "what does Admin actually mean?" answerable in one screen (look at the policies), and it makes refactoring trivial (swap a policy without touching every role that uses it).

    Creating and editing in the dashboard#

    Authorization → Roles → New role opens the editor:

    1. Name and description.
    2. Scope — Global or scoped to a tenant.
    3. Attach policies — search the catalog, click to add. The editor shows the resulting permission set so you can sanity-check.
    4. Save.

    After saving, the detail page shows three tabs:

    • Composition — the policies attached. Add or remove without touching the role identity.
    • Assignments — every user/credential/API-key currently assigned this role. Useful for revocation.
    • Activity — recent assignment events from the audit log.

    Global vs tenant-scoped#

    The Global group covers roles that apply application-wide. A user assigned a global role gets those permissions in every tenant they belong to.

    The Tenant group is scoped — the role only takes effect when checks are performed with that tenantId. Acme Corp's Admin role does not give the user any rights in Initech, even if both tenants exist in the same application.

    # Create a global role (no tenantId)
    curl -X POST https://your-app.authaz.io/api/v1/applications/{appId}/roles \
      -H "X-API-Key: $AUTHAZ_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "name": "Owner", "policyIds": ["pol_owner"] }'
     
    # Create a tenant-scoped role
    curl -X POST https://your-app.authaz.io/api/v1/applications/{appId}/tenants/{tenantId}/roles \
      -H "X-API-Key: $AUTHAZ_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "name": "Tenant Admin", "policyIds": ["pol_tenant_admin"] }'

    The dashboard surfaces tenant-scoped roles in the role list under each tenant's section, with the same role name allowed across tenants (so every tenant can have its own Admin if you want).

    Assigning a role#

    # Global assignment
    curl -X POST https://your-app.authaz.io/api/v1/role-assignments \
      -H "X-API-Key: $AUTHAZ_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "subjectType": "user",
        "subjectId": "user_01h...",
        "roleId": "role_member"
      }'
     
    # Tenant-scoped assignment
    curl -X POST https://your-app.authaz.io/api/v1/applications/{appId}/tenants/{tenantId}/role-assignments \
      -H "X-API-Key: $AUTHAZ_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "subjectType": "user",
        "subjectId": "user_01h...",
        "roleId": "role_admin"
      }'

    subjectType can be user, credential (M2M), or api_key (standalone). The same role machinery applies to all three.

    Revoking#

    curl -X DELETE https://your-app.authaz.io/api/v1/role-assignments/{assignmentId} \
      -H "X-API-Key: $AUTHAZ_API_KEY"

    Revocations take effect on the next permission check — no token re-issuance needed because checks read live state from Zeratul.

    Listing what a user has#

    # Every role assignment for a user
    curl https://your-app.authaz.io/api/v1/users/{userId}/role-assignments \
      -H "X-API-Key: $AUTHAZ_API_KEY"
    [
      { "id": "...", "roleId": "role_member", "tenantId": null, "scope": "global" },
      { "id": "...", "roleId": "role_admin",  "tenantId": "tenant_acme", "scope": "tenant" }
    ]

    The dashboard's Users → user-detail → Roles tab shows the same data with role names resolved.

    Role hierarchy via policy reuse#

    There's no built-in "Admin inherits from Member" mechanism — instead, share policies across roles:

    pol_invoices_writer   ← attached to Member, Admin, Owner
    pol_customer_admin    ← attached to        Admin, Owner
    pol_billing_owner     ← attached to                Owner
    

    Removing or editing pol_invoices_writer changes Member, Admin, and Owner in lockstep. This is faster and harder to misconfigure than chained inheritance.

    What about default roles?#

    The signup and invitations flows let you specify a defaultRoles list — every newly-created user is auto-assigned those roles. Most apps want ["role_user"] or similar as a baseline.

    Next steps#

    • Policies — the reusable bundles roles attach.
    • Resources — the catalog of permissions roles and policies draw from.
    • Access Explorer — confirm a role assignment actually grants what you expect.