Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cgwire/zou/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Zou implements a role-based access control (RBAC) system using Flask-Principal. Users are assigned roles that determine their permissions across the system.User Roles
Zou defines six user roles with hierarchical permissions:Role Hierarchy
Role Definitions
| Role | Code | Description | Typical Users |
|---|---|---|---|
| Admin | admin | Studio Manager | IT, Studio heads |
| Manager | manager | Production Manager | Producers, coordinators |
| Supervisor | supervisor | Department Lead | CG supervisors, leads |
| User | user | Artist | Modelers, animators, etc. |
| Client | client | External Reviewer | Clients, directors |
| Vendor | vendor | External Studio | Outsourcing partners |
Role Configuration
zou/app/models/person.py
Permission Levels
Admin Permissions
Full system access including:- User management (create, edit, delete users)
- System configuration
- All project access
- Department management
- Studio-wide settings
- API key generation
- Billing and subscription management
Manager Permissions
Project and production management:- Create and configure projects
- Assign team members to projects
- View all tasks in assigned projects
- Edit task status and assignments
- Manage schedules and milestones
- Export reports
- Client access management
Managers have project-scoped access. They can only manage projects they’re assigned to.
Supervisor Permissions
Department-level oversight:- Review tasks in their department
- Approve/request retakes
- View team performance
- Assign tasks to department members
- Limited project configuration
zou/app/services/user_service.py
Artist/User Permissions
Task-focused access:- View assigned tasks
- Update task status
- Upload preview files
- Add comments
- View related entities (assets/shots)
- Limited to assigned projects
Client Permissions
Review-only access:- View project progress
- Watch preview videos
- Add review comments
- Approve/reject work
- No editing capabilities
- Isolated view (can’t see other clients’ projects)
Clients have restricted access. Enable
is_clients_isolated on projects to prevent clients from seeing each other.Vendor Permissions
Outsourced work access:- View assigned tasks only
- Upload deliverables
- Limited project visibility
- Cannot see internal tasks
- Time-limited access
Permission Implementation
Flask-Principal Integration
Zou uses Flask-Principal for permission management:zou/app/utils/permissions.py
Permission Checks
Function-based
Exception-based
Permission Decorators
Protect routes with decorators:Identity Loading
User roles are loaded into the identity when JWT token is validated:zou/app/__init__.py
Project-Level Permissions
Team Membership
Users must be assigned to a project to access it:zou/app/models/project.py
Project Access Rules
| Role | Access Rule |
|---|---|
| Admin | All projects |
| Manager | Projects they’re assigned to |
| Supervisor | Projects they’re assigned to |
| User | Projects they’re assigned to |
| Client | Projects they’re assigned to (isolated) |
| Vendor | Projects they’re assigned to (limited) |
Client Isolation
Projects can isolate clients:- Clients only see their assigned tasks
- Cannot see other clients or team members
- Limited to review comments only
Task-Level Permissions
Task Assignment
Tasks have explicit assignees:zou/app/models/task.py
Task Access Rules
Artists can only access:- Tasks explicitly assigned to them
- Tasks in projects they’re team members of
- All tasks in their department
- Tasks in assigned projects
- All tasks in assigned projects
- All tasks in all projects
Task Query Filters
zou/app/services/user_service.py
Department-Based Permissions
Users can belong to multiple departments:zou/app/models/person.py
- Modeling - 3D modelers
- Rigging - Character TDs
- Animation - Animators
- Lighting - Lighting artists
- FX - Effects artists
- Compositing - Compositors
API Endpoint Protection
Endpoints are protected at the resource level:Common Patterns
Admin-Only Endpoints
Admin-Only Endpoints
Manager+ Endpoints
Manager+ Endpoints
Authenticated Endpoints
Authenticated Endpoints
Special Permissions
Bot Accounts
Bots are service accounts with long-lived API tokens:Person API Tokens
Users can generate personal API keys:- Have same permissions as the user
- Can be revoked independently
- Don’t expire with normal token rotation
Protected Accounts
Certain accounts cannot be modified:- Cannot be deleted
- Cannot change role
- Cannot be deactivated
Permission Caching
User data is cached in Redis to reduce database queries:- User role change
- Department assignment change
- Project team membership change
Security Best Practices
Principle of Least Privilege
Principle of Least Privilege
- Assign minimum necessary role
- Use supervisor role instead of manager when possible
- Regularly audit user permissions
- Remove users from projects when work is done
Client Security
Client Security
- Always enable
is_clients_isolatedfor client projects - Create separate client accounts (never share)
- Set expiration dates for temporary client access
- Review client permissions regularly
Vendor Security
Vendor Security
- Use vendor role for outsourced work
- Assign only specific tasks, not entire projects
- Set clear start/end dates
- Revoke access when contract ends
Permission Errors
When permission checks fail:Testing Permissions
Check current user permissions:Next Steps
Authentication
Learn about JWT authentication
User Management
Manage users and roles
Projects
Configure project access
Tasks
Assign and manage tasks