Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Role-Based Access Control (RBAC) Overview

General Bots implements a comprehensive Role-Based Access Control (RBAC) system designed as a secure, enterprise-grade alternative to Microsoft 365 / Google Workspace permission models. This system provides fine-grained access control across all suite applications.

Why RBAC?

RBAC is the industry standard for enterprise access control, used by:

  • Microsoft Azure Active Directory
  • Google Workspace Admin
  • AWS IAM
  • Kubernetes
  • All major enterprise platforms

Benefits Over Direct Permissions

ApproachProsCons
Direct User PermissionsSimple for small teamsUnmanageable at scale, audit nightmare
RBAC (Roles)Scalable, auditable, principle of least privilegeInitial setup complexity
RBAC + GroupsBest of both worlds, mirrors org structureRequires planning

Core Concepts

1. Users

Individual accounts that authenticate to the system. Users can be:

  • Internal employees - Full organization members
  • External guests - Partners, contractors, clients
  • Service accounts - For API integrations

2. Roles

Named collections of permissions. Roles define what actions can be performed.

┌─────────────────────────────────────────────────────────┐
│                     ROLE: Standard User                  │
├─────────────────────────────────────────────────────────┤
│ Permissions:                                             │
│   ✓ mail.read, mail.send                                │
│   ✓ calendar.read, calendar.write                       │
│   ✓ drive.read, drive.write, drive.share                │
│   ✓ docs.read, docs.write, docs.collaborate             │
│   ✓ meet.join, meet.create                              │
│   ✓ chat.read, chat.write                               │
│   ✓ tasks.read, tasks.write                             │
│   ✗ users.manage (NOT included)                         │
│   ✗ settings.organization (NOT included)                │
└─────────────────────────────────────────────────────────┘

3. Groups

Collections of users, typically mirroring organizational structure:

  • Departments (IT, HR, Finance, Sales)
  • Teams (Project Alpha, Support Team)
  • Access levels (Managers, External Contractors)

4. Permissions

Granular capabilities following the pattern: resource.action

mail.read          → Can read emails
mail.send          → Can send emails  
mail.admin         → Full mail administration

drive.read         → Can view files
drive.write        → Can upload/edit files
drive.share        → Can share with others
drive.share_external → Can share outside organization
drive.admin        → Full drive administration

Permission Inheritance

                    ┌──────────────┐
                    │  Permission  │
                    │  mail.send   │
                    └──────┬───────┘
                           │
              ┌────────────┴────────────┐
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │    Role     │          │    Role     │
       │ Standard    │          │   Guest     │
       │   User      │          │   User      │
       └──────┬──────┘          └─────────────┘
              │                        
    ┌─────────┴─────────┐              
    │                   │              
    ▼                   ▼              
┌─────────┐      ┌─────────────┐      
│  Group  │      │   Direct    │      
│  Sales  │      │ Assignment  │      
│  Team   │      │             │      
└────┬────┘      └──────┬──────┘      
     │                  │              
     ▼                  ▼              
┌─────────┐      ┌─────────────┐      
│  User   │      │    User     │      
│  Alice  │      │    Bob      │      
└─────────┘      └─────────────┘      

Users inherit permissions from:

  1. Direct role assignments - Roles assigned directly to the user
  2. Group memberships - Roles assigned to groups the user belongs to

Comparison with Office 365 / Google Workspace

Office 365 Equivalent Roles

General Bots RoleOffice 365 Equivalent
global_adminGlobal Administrator
billing_adminBilling Administrator
user_adminUser Administrator
exchange_adminExchange Administrator
sharepoint_adminSharePoint Administrator
teams_adminTeams Administrator
security_adminSecurity Administrator
compliance_adminCompliance Administrator
helpdesk_adminHelpdesk Administrator
reports_readerReports Reader

Google Workspace Equivalent Roles

General Bots RoleGoogle Workspace Equivalent
global_adminSuper Admin
user_adminUser Management Admin
groups_adminGroups Admin
sharepoint_adminDrive & Docs Admin
exchange_adminGmail Admin
teams_adminMeet & Chat Admin

Built-in System Roles

Administrative Roles

RoleDescriptionTypical Use
Global AdministratorFull system controlIT Director, CTO
Billing AdministratorSubscription & paymentsFinance team
Compliance AdministratorAudit, DLP, retentionLegal, Compliance
Security AdministratorThreats, access policiesSecurity team
User AdministratorUser & group managementHR, IT Helpdesk
Groups AdministratorGroup management onlyTeam leads
Helpdesk AdministratorPassword resets, supportIT Support

Service-Specific Admin Roles

RoleManages
Mail AdministratorMailboxes, mail flow, distribution lists
Drive AdministratorFile storage, sharing policies, quotas
Meet & Chat AdministratorVideo meetings, chat settings
Knowledge AdministratorKnowledge base, document libraries

End-User Roles

RoleDescriptionBest For
Power UserFull productivity + automationDevelopers, analysts
Standard UserNormal productivity accessRegular employees
Guest UserLimited external accessPartners, contractors
ViewerRead-only accessAuditors, observers

Permission Categories

Permissions are organized into logical categories:

Administration (admin)

  • org.* - Organization settings
  • users.* - User management
  • groups.* - Group management
  • roles.* - Role management
  • dns.* - DNS and domains

Compliance (compliance)

  • audit.* - Audit logs
  • compliance.* - Compliance policies
  • dlp.* - Data loss prevention
  • retention.* - Data retention
  • ediscovery.* - Legal discovery

Security (security)

  • security.* - Security settings
  • threats.* - Threat management
  • secrets.* - API keys and secrets

Productivity Apps

CategoryPermissions
mailread, send, delete, organize, delegate, admin
calendarread, write, share, delegate, rooms
driveread, write, delete, share, sync, admin
docsread, write, comment, share, templates
sheetread, write, share, macros, connections
slidesread, write, share, present
meetjoin, create, host, record, webinar
chatread, write, channels, external
tasksread, write, assign, projects, automation

AI & Bots (ai)

  • bots.* - Bot configuration
  • ai.* - AI assistant features
  • kb.* - Knowledge base
  • conversations.* - Bot conversations
  • attendant.* - Human handoff

Automation (automation)

  • autotask.* - Automated tasks
  • workflows.* - Workflow definitions
  • intents.* - AI intent management

Best Practices

1. Use Groups for Department Access

Group: Sales Team
  └── Role: Standard User
  └── Role: CRM Access (custom)
  
Group: IT Department  
  └── Role: Standard User
  └── Role: Helpdesk Administrator

2. Principle of Least Privilege

Start with the minimum permissions and add as needed:

  • New employees → Standard User
  • After training → Add specific permissions
  • Temporary access → Set expiration dates

3. Use Time-Limited Assignments

-- Role expires in 30 days
expires_at: 2025-08-14T00:00:00Z

4. Regular Access Reviews

  • Quarterly review of admin roles
  • Monthly review of external access
  • Automated alerts for unused permissions

5. Audit Everything

All permission changes are logged:

  • Who made the change
  • What was changed
  • When it happened
  • Why (if documented)

Migration from Other Platforms

From Microsoft 365

  1. Export Azure AD groups and roles
  2. Map to equivalent General Bots roles
  3. Import users and create groups
  4. Assign group-role mappings
  5. Verify with test accounts

From Google Workspace

  1. Export Google Admin directory
  2. Map organizational units to groups
  3. Map admin roles to equivalent roles
  4. Import and test

See Migration Guide for detailed instructions.

API Reference

List All Roles

GET /api/rbac/roles

Assign Role to User

POST /api/rbac/users/{user_id}/roles/{role_id}
Content-Type: application/json

{
  "expires_at": "2025-12-31T23:59:59Z"  // Optional
}

Add User to Group

POST /api/rbac/users/{user_id}/groups/{group_id}

Get User’s Effective Permissions

GET /api/rbac/users/{user_id}/permissions

Response:

{
  "user_id": "uuid",
  "direct_roles": [...],
  "group_roles": [...],
  "groups": [...],
  "effective_permissions": [
    "mail.read",
    "mail.send",
    "drive.read",
    ...
  ]
}

Next Steps