Role-Based Access Control
Roles are the primary mechanism for controlling which documents each user can access. When a user queries the AI, they only see answers from documents they have permission to access.How It Works
- User sends request with roles in
X-External-Rolesheader - System builds access filter based on user’s roles
- Documents are filtered to only those matching user’s roles
- AI generates answer from accessible documents only
Key Concepts
Roles
A role is simply a string that represents a permission group:hr- Human Resources teamfinance- Finance departmentmanager- Management levelall-staff- Everyone in the company
Document ACLs
Each document (or folder) has an Access Control List specifying which roles can access it:| Document | ACL Roles |
|---|---|
| Employee Handbook | all-staff |
| HR Policies | hr |
| Financial Reports | finance, executive |
| Management Guidelines | manager, executive |
Role Matching
A user can access a document if they have any of the document’s ACL roles:Example Flow
Setup
- Partner uploads HR documents with
aclRoles: ["hr"] - Partner uploads company-wide docs with
aclRoles: ["all-staff"]
Request
Result
Alice sees answers from:- HR documents (she has “hr” role)
- Company-wide documents (she has “all-staff” role)
- Finance documents
- Executive documents