Roles-Based Access Control
Multiforum uses a comprehensive role-based permission system that governs what actions users can perform across the platform. The system operates at both server-wide and channel-specific levels.
Why Users Have Two Profiles
Every authenticated user in Multiforum has two separate identities:
1. User Profile
Your regular user profile is used for:
- Creating discussions, events, and comments
- Upvoting and reacting to content
- Managing your account settings
- Your public-facing identity in conversations
Your username is visible on all content you create and cannot be changed after registration.
2. Moderation Profile
Your moderation profile is a separate identity used for:
- Reporting content
- Giving feedback to other users
- Taking moderation actions (if you're a moderator)
- Commenting on moderation issues
Why separate profiles?
- Privacy: Moderators may not want their regular username associated with moderation actions
- Neutrality: Content authors see feedback from a moderation profile, encouraging objectivity
- Accountability: All moderation actions link to a moderation profile for audit trails
- Safety: Moderators can participate in discussions without revealing their moderator status
You can set a custom display name for your moderation profile that differs from your username.
Permission System Overview
Multiforum has two parallel permission systems:
User Permissions
Control regular-user actions:
canCreateDiscussion- Post new discussionscanCreateComment- Comment on discussions/eventscanCreateEvent- Create eventscanUpvoteDiscussion- Upvote discussionscanUpvoteComment- Upvote commentscanUploadFile- Upload files and imagescanUpdateChannel- Modify channel settings (owners only)
Moderator Permissions
Control moderation actions:
canReport- Report content for reviewcanGiveFeedback- Give feedback to content authorscanHideComment/canHideDiscussion/canHideEvent- Archive contentcanEditComments/canEditDiscussions/canEditEvents- Edit others' contentcanSuspendUser- Suspend users from a channelcanLockChannel- Lock a channel to prevent new contentcanOpenSupportTickets/canCloseSupportTickets- Manage support issuescanAddMods/canRemoveMods- Manage channel moderatorscanAddOwners/canRemoveOwners- Manage channel ownerscanChangeSettings- Modify channel configurationcanEditWiki- Edit wiki pages
Role Types
Server Roles
Server-wide role definitions that apply across all channels:
| Role | Description |
|---|---|
DefaultServerRole | Baseline permissions for all users |
DefaultModRole | Baseline moderation permissions |
DefaultElevatedModRole | Enhanced moderation permissions |
DefaultSuspendedRole | Restricted permissions for suspended users |
DefaultSuspendedModRole | Restricted permissions for suspended moderators |
Channel Roles
Channel-specific role definitions that can override server defaults:
| Role | Description |
|---|---|
DefaultChannelRole | User permissions for a specific channel |
DefaultModRole | Moderator permissions for a specific channel |
ElevatedModRole | Enhanced moderator permissions for a channel |
SuspendedRole | Restricted permissions for users suspended in a channel |
SuspendedModRole | Restricted permissions for mods suspended in a channel |
User Classifications
Standard Users
Regular authenticated users who:
- Use
DefaultChannelRoleor fall back toDefaultServerRole - Can create content, upvote, and react based on their role permissions
- All authenticated users have basic moderation capabilities (like reporting)
Channel Owners
Users in Channel.Admins who:
- Have full permissions within their channels
- Bypass all user and moderator permission checks
- Can manage moderators, settings, and all content
Elevated Moderators
Users explicitly in Channel.Moderators who:
- Have stronger moderation permissions than standard users
- Use
ElevatedModRolepermissions - Can archive content, manage suspensions, and more
Suspended Users
Users in Channel.SuspendedUsers or ServerConfig.SuspendedUsers who:
- Use
SuspendedRolewith heavily restricted permissions - Can typically only view content, not create or interact
- Can see the related moderation issue explaining their suspension
Permission Resolution Order
When checking permissions, the system follows this priority:
For User Permissions
- Channel Owner? → Grant all permissions
- Suspended? → Use suspended user role permissions
- Has channel-specific role? → Use channel role permissions
- Has channel default role? → Use channel default permissions
- Fall back → Use server default role permissions
For Moderator Permissions
- Channel Owner? → Grant all permissions
- Suspended Mod? → Use suspended moderator role permissions
- Elevated Moderator? → Use elevated moderator role permissions
- Fall back → Use default moderator role permissions
Suspension System
Suspensions can be:
- Time-limited: Expire after a specified date
- Indefinite: Require manual removal
Suspension Scope
| Scope | Effect |
|---|---|
| Channel-level | User suspended from specific channel only |
| Server-level | User suspended from server-wide actions |
Suspension Lifecycle
- Moderator initiates suspension via "Archive and Suspend" action
Suspensionnode created with expiry or indefinite flag- Backend checks suspension status on every action
- Expired suspensions are automatically cleaned up
- Users can be unsuspended via moderation interface
Transparency
- Every suspension links to a moderation Issue
- Suspended users can view the issue to understand why they're blocked
- All suspension-related actions are logged for auditability
Key Implementation Files
| File | Purpose |
|---|---|
rules/rules.ts | GraphQL Shield permission rules |
rules/permission/hasChannelPermission.ts | User channel permissions |
rules/permission/hasChannelModPermission.ts | Moderator channel permissions |
rules/permission/hasServerPermission.ts | Server-level permissions |
rules/permission/getActiveSuspension.ts | Suspension status checking |
utils/permissionUtils.ts | Frontend permission helpers |