Repository navigation
fix: staff only commands - #495
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
guild_interaction_handler.rsnow checks if the user is staff (using the newis_staff_memberandis_staff_userhelpers) before allowing command execution. Non-staff users receive a permission denied response.guild_messages_handler.rsnow silently ignores commands from non-staff users.Utility Functions:
is_staff_memberandis_staff_userhelpers in new moduleutils/command/staff_access.rsto encapsulate staff-checking logic for both dual and single server modes, including super admin handling.utils/command/mod.rsfor easier access throughout the codebase.guild_interaction_handler.rsto use the new helpers.Documentation:
docs/guides/commands.mdto clearly explain the new staff-only command restrictions and how they differ between dual-server and single-server modes.