AccessLevel - jimdroberts/FishMMO GitHub Wiki

Description

Enum representing user access levels and permissions in the game. Used for authentication, moderation, and feature gating.


API Access

Fields

  • Banned = 0

    User is banned and cannot access the game.

  • Player

    Regular player with standard permissions.

  • Guide

    Guide or helper with limited support permissions.

  • GameMaster

    Game master with advanced moderation and support permissions.

  • Administrator

    Administrator with full permissions and access to all features.


Basic Usage

Setup

  1. Use AccessLevel to represent and check user permissions throughout the game.
  2. Assign appropriate access levels to users based on their roles.

Example

// Example 1: Checking access level
if (user.AccessLevel == AccessLevel.Administrator) {
    // Grant admin privileges
}

// Example 2: Restricting banned users
if (user.AccessLevel == AccessLevel.Banned) {
    // Deny access
}

Best Practices

  • Use clear, descriptive names for each access level to avoid confusion.
  • Always check access levels before granting permissions or features.
  • Document any changes to access level logic for maintainability.
  • Use enums for type safety and clarity in permission checks.
⚠️ **GitHub.com Fallback** ⚠️