# Crash course: RBAC In Business

🔐 **Building Amasoft’s Role-Based Access Control System in TypeDB** 🔐

_A professional learning journey_

## [](#_prologue_the_mandate)Prologue: The Mandate

The IT Director has handed you a single-page brief. Amasoft - a mid-sized technology company that has grown through three acquisitions - has no centralised access control. Permissions live in spreadsheets. Role assignments are inconsistent across regions. Nobody has a clear picture of who has access to what, or why.

The compliance team has flagged it. The security team has flagged it. The auditors have flagged it. Your mandate: build Amasoft’s first centralised role-based access control (RBAC) system. Every identity, every system, every access grant, every policy - all of it in TypeDB.

The schema you will build in this guide is a foundation you can adapt for your own company’s production-grade RBAC system. The queries you will write are the queries such a system runs thousands of times a day. By the end, you will have:

1.  Modelled a complete identity hierarchy - employees, contractors, interns, and service accounts
    
2.  Built an org structure with reporting lines and department membership
    
3.  Designed an access model that captures who has access, why, how, and until when
    
4.  Written compliance-grade audit queries that answer the hard questions
    
5.  Encoded access policies as reusable, composable TypeQL functions
    
6.  Built a production-grade provisioning pipeline with idempotent inserts
    

👥 Cast of characters

*   **Alex Chen** - a contractor who becomes a full-time employee in Chapter Three
    
*   **Sam Rivera** - an L4 engineering manager promoted to L5 in Chapter Five
    
*   **Michelle Rocksmasher** - Amasoft’s CISO, L7, who drives compliance requirements and approves policy exceptions
    
*   **The compliance team** - who ask the hard questions that drive Chapters Six and Seven
    

🗺️ How to use this guide

Each chapter introduces new concepts through Amasoft’s story. Read the story, and study the code. Every TypeQL code block is real code you can run in TypeDB Studio. At the end of each chapter you’ll find a Challenge to revise your new skills. This guide is fully self-contained and is intended to help you learn TypeDB in a real-world context.

[Query composition](../quickstart/query-composition/index.md) [Chapter Zero: Get Started in TypeDB Studio](00-get-started-studio/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/learn-typedb/modules/ROOT/pages/rbac-in-business/index.adoc) Edit this page on GitHub.