> ## Documentation Index
> Fetch the complete documentation index at: https://docs.celestia.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# Role Permissions (Permit)

> Grant specific roles permission to use restricted commands

## Overview

The permit system allows you to grant specific roles permission to use commands that would normally require certain permissions. This creates a flexible permission structure where you can delegate command access without granting full Discord permissions.

<Info>
  Permits work alongside Discord permissions - they grant additional access, not replace existing permission requirements.
</Info>

***

## Commands

<AccordionGroup>
  <Accordion title="permit add" icon="plus">
    Allow a role to use a specific command.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~permit add <role> <command>
      ```

      ```bash Example theme={null}
      ~permit add @Moderators ban
      ~permit add @Helpers kick
      ~permit add Staff warn
      ~rolepermit add @Trusted purge
      ```
    </CodeGroup>

    **Parameters:**

    * **role** — Role mention, ID, or name
    * **command** — Command name to grant access to

    **What It Does:**

    * Grants the role permission to use the command
    * Works with role mentions, IDs, or names
    * Multiple commands can be added per role

    **Aliases:** `rolepermit add`, `cmdpermit add`\
    **Permissions:** Administrator
  </Accordion>

  <Accordion title="permit remove" icon="minus">
    Remove a role's permission for a specific command.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~permit remove <role> <command>
      ```

      ```bash Example theme={null}
      ~permit remove @Moderators ban
      ~permit remove @Helpers kick
      ~permit remove Staff warn
      ~rolepermit remove @Trusted purge
      ```
    </CodeGroup>

    **Parameters:**

    * **role** — Role mention, ID, or name
    * **command** — Command name to revoke access from

    **What It Does:**

    * Removes the role's permission for the command
    * Role can no longer use that command
    * Other permits for the role remain intact

    **Aliases:** `rolepermit remove`, `cmdpermit remove`\
    **Permissions:** Administrator
  </Accordion>

  <Accordion title="permit list" icon="list">
    View all role permissions in your server.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~permit list
      ```

      ```bash Example theme={null}
      ~permit list
      ~rolepermit list
      ~cmdpermit list
      ```
    </CodeGroup>

    **What It Shows:**

    * All roles with command permissions
    * Which commands each role can use
    * Paginated display (10 entries per page)
    * Total count of permits

    **Aliases:** `rolepermit list`, `cmdpermit list`\
    **Permissions:** Administrator
  </Accordion>

  <Accordion title="permit clear" icon="trash">
    Clear all role permissions in your server.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~permit clear
      ```

      ```bash Example theme={null}
      ~permit clear
      ~rolepermit clear
      ~cmdpermit clear
      ```
    </CodeGroup>

    **What It Does:**

    * Removes ALL role permits from the server
    * Shows count of cleared roles
    * Cannot be undone

    <Warning>
      This removes all permit configurations. Use `permit remove` for individual permissions.
    </Warning>

    **Aliases:** `rolepermit clear`, `cmdpermit clear`\
    **Permissions:** Administrator
  </Accordion>
</AccordionGroup>

***

## How It Works

<Steps>
  <Step title="Grant Role Permissions">
    Add permissions for roles to use specific commands:

    ```bash theme={null}
    ~permit add @Moderators ban
    ~permit add @Moderators kick
    ~permit add @Helpers warn
    ```
  </Step>

  <Step title="Members Get Access">
    Users with those roles can now use the commands:

    * Members with @Moderators can use ban and kick
    * Members with @Helpers can use warn
    * Permissions stack with Discord permissions
  </Step>

  <Step title="Manage Permits">
    View, remove, or clear permissions as needed:

    ```bash theme={null}
    # View all permits
    ~permit list

    # Remove specific permit
    ~permit remove @Helpers warn

    # Clear everything
    ~permit clear
    ```
  </Step>
</Steps>

***

## Role Resolution

The system accepts roles in multiple formats:

1. **Mention** — `@Moderators` (most reliable)
2. **Role ID** — `123456789012345678`
3. **Role Name** — `Moderators` (case-insensitive)

<Note>
  If multiple roles have similar names, use mention or ID for accuracy.
</Note>

***

## Permission Requirements

<CardGroup cols={2}>
  <Card title="Bot Permissions" icon="robot">
    No special permissions required beyond basic message reading and sending.
  </Card>

  <Card title="User Permissions" icon="user">
    Command Requirements:

    * **Administrator** — Required for all permit commands
  </Card>
</CardGroup>

***

## Aliases

All permit commands support multiple aliases:

<CardGroup cols={3}>
  <Card title="permit" icon="user-shield">
    Main command
  </Card>

  <Card title="rolepermit" icon="users-gear">
    Role-focused alias
  </Card>

  <Card title="cmdpermit" icon="terminal">
    Command-focused alias
  </Card>
</CardGroup>

***

## Usage Examples

<Tabs>
  <Tab title="Moderation Team">
    ```bash theme={null}
    # Grant moderator commands
    ~permit add @Moderators ban
    ~permit add @Moderators kick
    ~permit add @Moderators mute
    ~permit add @Moderators warn

    # Grant helper commands
    ~permit add @Helpers warn
    ~permit add @Helpers mute

    # View configuration
    ~permit list
    ```
  </Tab>

  <Tab title="Staff Hierarchy">
    ```bash theme={null}
    # Senior staff gets full access
    ~permit add @Senior ban
    ~permit add @Senior kick
    ~permit add @Senior mute

    # Junior staff gets limited access
    ~permit add @Junior warn
    ~permit add @Junior mute

    # Trial staff gets minimal access
    ~permit add @Trial warn
    ```
  </Tab>

  <Tab title="Specialized Roles">
    ```bash theme={null}
    # Event managers
    ~permit add @EventManager announce
    ~permit add @EventManager giveaway

    # Support team
    ~permit add @Support ticket
    ~permit add @Support close

    # Content moderators
    ~permit add @ContentMod purge
    ~permit add @ContentMod warn
    ```
  </Tab>

  <Tab title="Management">
    ```bash theme={null}
    # View all permits
    ~permit list

    # Remove specific permission
    ~permit remove @Helpers mute

    # Clear all permits
    ~permit clear
    ```
  </Tab>

  <Tab title="Using Role IDs">
    ```bash theme={null}
    # Add using role ID
    ~permit add 123456789012345678 ban

    # Add using role name
    ~permit add Moderators kick

    # Add using mention
    ~permit add @Staff warn
    ```
  </Tab>
</Tabs>

***

## Common Use Cases

<AccordionGroup>
  <Accordion title="Delegate moderation without full permissions" icon="gavel">
    ```bash theme={null}
    # Give mods ban command without Ban Members permission
    ~permit add @Moderators ban

    # Give helpers warn without Manage Messages
    ~permit add @Helpers warn
    ```

    Allows command access without granting Discord permissions.
  </Accordion>

  <Accordion title="Create tiered staff structure" icon="layer-group">
    ```bash theme={null}
    # Senior staff - full access
    ~permit add @Senior ban
    ~permit add @Senior kick
    ~permit add @Senior mute

    # Junior staff - limited access
    ~permit add @Junior warn
    ~permit add @Junior timeout
    ```

    Different permission levels for different staff tiers.
  </Accordion>

  <Accordion title="Specialized role access" icon="star">
    ```bash theme={null}
    # Event coordinators
    ~permit add @Events giveaway
    ~permit add @Events announce

    # Support team
    ~permit add @Support ticket
    ```

    Grant access to specific features based on role purpose.
  </Accordion>

  <Accordion title="Temporary permissions" icon="clock">
    ```bash theme={null}
    # Grant temporary access
    ~permit add @Trial warn

    # Remove after trial period
    ~permit remove @Trial warn
    ```

    Easy to add and remove as needed.
  </Accordion>
</AccordionGroup>

***

## Important Notes

<Warning>
  **Permission Stacking**

  * Permits grant ADDITIONAL access
  * They do not override Discord permissions
  * Bot still needs required permissions
  * Users still need basic channel access
</Warning>

<Info>
  **Best Practices**

  * Use specific role names to avoid confusion
  * Document which roles have which permits
  * Review permits regularly with `permit list`
  * Remove permits when roles change
</Info>

***

## Related Features

<CardGroup cols={2}>
  <Card title="Enable/Disable Commands" icon="toggle-on" href="/enable-disable">
    Control which commands are available server-wide
  </Card>

  <Card title="Role Management" icon="user-gear" href="/role">
    Create and manage server roles
  </Card>
</CardGroup>
