Overview
PassTru implements a comprehensive role-based access control system that ensures the right people have the right level of access to your events and attendee data.User Roles
PassTru supports four distinct roles, each with specific permissions and access levels:Super Admin
Platform owner with full system access, client management, and pricing control.
Client
Organization owner who creates events, manages attendees, and controls event managers.
Event Manager
Assigned staff with limited access to specific events for check-in operations.
Attendee
End users with access to their personal portal and check-in functionality.
Role Implementation
Authentication & Authorization
PassTru uses a custom role guard system to protect routes and features:src/components/RoleGuard.tsx
Role Data Fetching
User roles and organization memberships are fetched in parallel for optimal performance:src/hooks/useAuth.tsx
Client Role Features
- Event Management
- Attendee Control
- Team Management
- Create unlimited events (with tokens)
- Configure event details and attendee fields
- Suspend or delete events
- Access full event portal
Event Manager Role
Event Managers have restricted access designed for operational staff:What Event Managers Can Do
- Access only assigned events
- View check-in management interface
- Search and manually check in attendees
- Send individual confirmation emails
- Toggle check-in page activation
What Event Managers Cannot Do
Creating Event Managers
Clients create Event Manager accounts through the Team Management interface:src/pages/client/EventManagerList.tsx
Organization Context
The authentication system maintains organization context throughout the user session:- Data isolation between organizations
- Correct branding display
- Proper event routing
- Secure data access
Navigation & UI Adaptation
The interface adapts based on user role:- Client View
- Event Manager View
- Full sidebar with all sections
- Event Portal shows all tabs (Dashboard, Attendees, Check-In, Branding)
- Access to organization settings
- Token purchase options
Security Best Practices
Row-Level Security: All database operations respect organization and role boundaries through Supabase RLS policies.
- Frontend Guards: Prevent unauthorized route access
- Backend Validation: Edge functions verify permissions
- Database Policies: RLS enforces data isolation
- Session Management: Secure token-based authentication
Role Assignment
- Super Admin: Manually assigned in database
- Client: Automatically assigned upon organization creation
- Event Manager: Created by Client via admin interface
- Attendee: Public role, no authentication required for portal access