Skip to content

fix: staff only commands - #495

Merged
Akinator31 merged 7 commits into
mainfrom
fix/staff-only-commands
Oct 14, 2026
Merged

Akinator31 merged 7 commits into
mainfrom
fix/staff-only-commands

Conversation

@Akinator31

Copy link
Copy Markdown
Member

This pull request tightens command access controls to ensure that both slash and text commands are strictly limited to staff members, with precise logic for dual-server and single-server modes. It introduces utility functions to centralize staff-checking logic, updates the command handlers to enforce staff-only access, and revises the documentation to clarify the new permissions model.

Access Control Enforcement:

  • Slash command handling in guild_interaction_handler.rs now checks if the user is staff (using the new is_staff_member and is_staff_user helpers) before allowing command execution. Non-staff users receive a permission denied response.
  • Text command handling in guild_messages_handler.rs now silently ignores commands from non-staff users.

Utility Functions:

  • Added is_staff_member and is_staff_user helpers in new module utils/command/staff_access.rs to encapsulate staff-checking logic for both dual and single server modes, including super admin handling.
  • Re-exported the new helpers in utils/command/mod.rs for easier access throughout the codebase.
  • Updated imports in guild_interaction_handler.rs to use the new helpers.

Documentation:

  • Updated docs/guides/commands.md to clearly explain the new staff-only command restrictions and how they differ between dual-server and single-server modes.

@Akinator31 Akinator31 self-assigned this Oct 14, 2026
@Akinator31
Akinator31 merged commit 40ea506 into main Oct 14, 2026
2 checks passed
@Akinator31
Akinator31 deleted the fix/staff-only-commands branch October 14, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant