Overview
EventPalour implements a multi-layered role system with three distinct permission scopes: Platform Roles, Platform Admin Levels, and Workspace Roles. Each scope serves different purposes in the system’s security and access control.Role Hierarchy
Platform Roles
Platform roles define the primary user type at the application level. Every user has one platform role.Organizer
Users who create and manage events. Can create workspaces, organize events, sell tickets, and build teams.
Attendee
Users who discover and attend events. Can browse events, purchase tickets, and register for events.
Platform Role Assignment
The platform role is stored in theuser table:
Users typically choose their platform role during onboarding. Organizers are guided to create their first workspace.
Role Capabilities
| Capability | Organizer | Attendee |
|---|---|---|
| Create workspaces | ✅ | ❌ |
| Create events | ✅ | ❌ |
| Manage tickets | ✅ | ❌ |
| Invite team members | ✅ | ❌ |
| Browse events | ✅ | ✅ |
| Purchase tickets | ✅ | ✅ |
| Register for events | ✅ | ✅ |
| Attend events | ✅ | ✅ |
A user can have both roles functionally. An organizer can also attend other events as an attendee.
Platform Admin Levels
Platform admins have elevated privileges for managing the entire EventPalour platform. These are internal staff roles, separate from regular users.Admin Schema
Platform admins are stored in theplatform_admins table:
Admin Level Responsibilities
- Super Admin
- Support
- Finance
- Moderator
Full System Access
- Manage all platform admins
- Access all workspaces and events
- Modify system settings
- View all audit logs
- Override any restrictions
Granular Permissions
Thepermissions JSONB field allows fine-grained access control:
Permissions can be customized per admin. A support team lead might have
canManageUsers: true while regular support staff have it set to false.Workspace Roles
Within each workspace, members are assigned roles that control their access to workspace resources.Workspace Role Assignment
Roles are assigned in theworkspace_members table:
Workspace Role Matrix
| Permission | Admin | Moderator | Member |
|---|---|---|---|
| Workspace Management | |||
| Edit workspace settings | ✅ | ❌ | ❌ |
| Delete workspace | ✅ | ❌ | ❌ |
| Manage invite codes | ✅ | ❌ | ❌ |
| Member Management | |||
| Invite members | ✅ | ❌ | ❌ |
| Remove members | ✅ | ❌ | ❌ |
| Change member roles | ✅ | ❌ | ❌ |
| Event Management | |||
| Create events | ✅ | ✅ | ❌ |
| Edit events | ✅ | ✅ | ❌ |
| Delete events | ✅ | ✅ | ❌ |
| Manage event categories | ✅ | ✅ | ❌ |
| Ticket Management | |||
| Create ticket types | ✅ | ✅ | ❌ |
| Configure tickets | ✅ | ✅ | ❌ |
| View ticket sales | ✅ | ✅ | ❌ |
| Process refunds | ✅ | ❌ | ❌ |
| Content Management | |||
| Manage speakers | ✅ | ✅ | ❌ |
| Publish announcements | ✅ | ✅ | ❌ |
| Moderate channels | ✅ | ✅ | ❌ |
| Read Access | |||
| View workspace | ✅ | ✅ | ✅ |
| View events | ✅ | ✅ | ✅ |
| View channels | ✅ | ✅ | ✅ |
| Participate in channels | ✅ | ✅ | ✅ |
Admin
Full control over the workspace including settings, members, events, and financial operations.
Moderator
Can manage events and content but cannot modify workspace settings or manage members.
Member
Read-only access to workspace resources. Can participate but not manage.
Special Workspace Relationships
Workspace Owner
The user who creates a workspace is stored inworkspace.user_id:
The workspace owner has implicit admin privileges even if not explicitly listed in
workspace_members. Deleting the owner account cascades to delete the workspace.Multiple Workspace Memberships
Users can be members of multiple workspaces with different roles:Role Assignment Workflows
Platform Role Selection
Workspace Invitation
Platform Admin Assignment
Permission Checking
Checking Platform Role
Checking Workspace Role
Checking Platform Admin
Best Practices
Principle of Least Privilege
Principle of Least Privilege
Always assign the minimum role required:
- Default workspace invitations to “member”
- Only promote to “moderator” or “admin” when necessary
- Regularly audit admin permissions
Role Transitions
Role Transitions
Document when users should be promoted:
- Member → Moderator: Trusted contributor managing content
- Moderator → Admin: Team lead with financial responsibility
- User → Platform Admin: Internal staff only
Separation of Concerns
Separation of Concerns
Keep roles separate:
- Platform roles define user type (organizer/attendee)
- Workspace roles define workspace access
- Admin levels define platform management access
Audit Trail
Audit Trail
Log all role changes:
- Track who granted admin access
- Record permission modifications
- Monitor privilege escalation
Owner Protection
Owner Protection
Protect workspace owners:
- Prevent owner from being removed as member
- Require ownership transfer before deletion
- Cascade delete workspace if owner account deleted
Common Scenarios
Scenario 1: Solo Organizer
Scenario 2: Team of Organizers
Scenario 3: Platform Administrator
Technical Details
Schema Locations
Key Relationships
Defined in/lib/db/schema/relations.ts:
- User has one platform admin record (one-to-one)
- User has many workspace memberships (one-to-many)
- Workspace has many members (one-to-many)
- Platform admin belongs to user (many-to-one)