Skip to main content

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 discussions
  • canCreateComment - Comment on discussions/events
  • canCreateEvent - Create events
  • canUpvoteDiscussion - Upvote discussions
  • canUpvoteComment - Upvote comments
  • canUploadFile - Upload files and images
  • canUpdateChannel - Modify channel settings (owners only)

Moderator Permissions

Control moderation actions:

  • canReport - Report content for review
  • canGiveFeedback - Give feedback to content authors
  • canHideComment / canHideDiscussion / canHideEvent - Archive content
  • canEditComments / canEditDiscussions / canEditEvents - Edit others' content
  • canSuspendUser - Suspend users from a channel
  • canLockChannel - Lock a channel to prevent new content
  • canOpenSupportTickets / canCloseSupportTickets - Manage support issues
  • canAddMods / canRemoveMods - Manage channel moderators
  • canAddOwners / canRemoveOwners - Manage channel owners
  • canChangeSettings - Modify channel configuration
  • canEditWiki - Edit wiki pages

Role Types

Server Roles

Server-wide role definitions that apply across all channels:

RoleDescription
DefaultServerRoleBaseline permissions for all users
DefaultModRoleBaseline moderation permissions
DefaultElevatedModRoleEnhanced moderation permissions
DefaultSuspendedRoleRestricted permissions for suspended users
DefaultSuspendedModRoleRestricted permissions for suspended moderators

Channel Roles

Channel-specific role definitions that can override server defaults:

RoleDescription
DefaultChannelRoleUser permissions for a specific channel
DefaultModRoleModerator permissions for a specific channel
ElevatedModRoleEnhanced moderator permissions for a channel
SuspendedRoleRestricted permissions for users suspended in a channel
SuspendedModRoleRestricted permissions for mods suspended in a channel

User Classifications

Standard Users

Regular authenticated users who:

  • Use DefaultChannelRole or fall back to DefaultServerRole
  • 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 ElevatedModRole permissions
  • Can archive content, manage suspensions, and more

Suspended Users

Users in Channel.SuspendedUsers or ServerConfig.SuspendedUsers who:

  • Use SuspendedRole with 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

  1. Channel Owner? → Grant all permissions
  2. Suspended? → Use suspended user role permissions
  3. Has channel-specific role? → Use channel role permissions
  4. Has channel default role? → Use channel default permissions
  5. Fall back → Use server default role permissions

For Moderator Permissions

  1. Channel Owner? → Grant all permissions
  2. Suspended Mod? → Use suspended moderator role permissions
  3. Elevated Moderator? → Use elevated moderator role permissions
  4. 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

ScopeEffect
Channel-levelUser suspended from specific channel only
Server-levelUser suspended from server-wide actions

Suspension Lifecycle

  1. Moderator initiates suspension via "Archive and Suspend" action
  2. Suspension node created with expiry or indefinite flag
  3. Backend checks suspension status on every action
  4. Expired suspensions are automatically cleaned up
  5. 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

FilePurpose
rules/rules.tsGraphQL Shield permission rules
rules/permission/hasChannelPermission.tsUser channel permissions
rules/permission/hasChannelModPermission.tsModerator channel permissions
rules/permission/hasServerPermission.tsServer-level permissions
rules/permission/getActiveSuspension.tsSuspension status checking
utils/permissionUtils.tsFrontend permission helpers