The Three-Role System
The application uses a simplified yet powerful three-role hierarchy:Admin
Full system access with unrestricted permissions
Assistant
Front desk operations with master code elevation
Artist
Limited to own schedule, portfolio, and reports
Role Assignment
Each user account is assigned exactly one role during creation. The role determines:- Which resources and actions the user can access
- Whether ownership restrictions apply (for artists)
- Which operations require master code elevation (for assistants)
users.role field and can be one of:
data/models/user.py:12 for the user model definition.
Artist Linking
Users with theartist role must be linked to an artist profile via the artist_id field:
- Appointments and schedule blocks
- Portfolio uploads
- Financial reports and transactions
- Client notes and consent forms (for their appointments)
Permission Philosophy
The RBAC system is designed around three core principles:1. Fail-Safe Defaults
Any resource/action combination not explicitly defined in the RBAC matrix defaults todeny. This ensures new features are secure by default.
2. Least Privilege
Each role receives only the permissions necessary for their job function:- Artists can manage their own work but cannot access studio-wide settings
- Assistants handle daily operations but need admin approval (via master code) for sensitive actions
- Admins have unrestricted access for studio management
3. Defense in Depth
Permissions are enforced at multiple layers:- UI layer: Hide/disable controls based on
can()checks - Service layer: Use
enforce()before database writes - API layer: Validate permissions on every request
services/permissions.py:167-189 for the enforce() implementation.
Permission Policies
The RBAC matrix uses four distinct policy values:allow - Full Access
allow - Full Access
User can perform this action without restrictions.Example: Admin can edit any client record.
own - Ownership Required
own - Ownership Required
User can only perform this action on resources they own (via
artist_id matching).Example: Artist can only edit appointments assigned to them.locked - Master Code Required
locked - Master Code Required
Assistant can perform this action only after entering the master code for temporary elevation.Example: Assistant needs master code to delete a client or process a refund.
deny - No Access
deny - No Access
User cannot perform this action under any circumstances.Example: Artist cannot access system security settings.
Master Code Elevation
Assistants can temporarily gain elevated permissions by entering the studio’s master code. This is a key security feature that allows:- Day-to-day operations without constant admin oversight
- Protection of sensitive actions (refunds, client deletion, cash close)
- Audit trail of when elevated permissions were used
locked for assistants.
Learn more about master code elevation in Assistant Role
Key Resources
The permission system controls access to six major resource categories:| Resource | Description | Key Actions |
|---|---|---|
agenda | Appointments and schedule | view, create, edit, cancel, complete |
clients | Client database | view, create, edit, delete, consent |
staff | User and artist management | view, manage_users, toggle_active |
reports | Financial reports and transactions | view, export, refund_void, cash_close |
inventory | Stock and supplies | view, create_item, stock_in, stock_adj |
security | System settings and security | settings, audit, backup, rotate_code |
services/permissions.py:38-87.
Implementation
The permission system is centralized in theservices/permissions module:
services/permissions.py:115-145 for the core can() function.
Next Steps
Admin Role
Learn about full system access and admin capabilities
Assistant Role
Understand front desk operations and master code elevation
Artist Role
Discover artist-specific permissions and limitations
Permissions Matrix
View the complete RBAC permission matrix