Skip to content

Add permission checks to ban-related menus for enhanced security - #17

Merged
Adammatthiesen merged 1 commit into
mainfrom
more-security
Oct 18, 2026
Merged

Adammatthiesen merged 1 commit into
mainfrom
more-security

Conversation

@Adammatthiesen

Copy link
Copy Markdown
Member

This pull request introduces a permissions system for menu access throughout the global ban menu system. Now, each menu checks if the player has the appropriate permission before opening, and displays an error message if access is denied. The permission required for each menu is determined based on the action type (ban, temp ban, IP ban, kick, etc.).

Permission enforcement for menu access:

  • Added a requiredPermission() method to all menu classes (PaginatedScreen, BanListMenu, PunishmentMenu, PunishMenu, PunishReasonMenu, PunishDurationMenu, PunishConfirmationMenu), specifying the necessary permission for each menu. [1] [2] [3] [4] [5] [6] [7]
  • Updated the open() methods in all menus to check permissions using PermissionRegistry.checkPermission() before displaying the menu, sending a red error message if the user lacks permission. [1] [2] [3]

Integration and code improvements:

  • Added necessary imports for Permission, PermissionRegistry, and ChatFormatting where required. [1] [2] [3] [4] [5] [6] [7] [8]

This change ensures that only authorized users can access sensitive ban-related menus, improving security and user feedback.

@Adammatthiesen
Adammatthiesen marked this pull request as ready for review October 18, 2026 05:58
@Adammatthiesen
Adammatthiesen merged commit 65a8f34 into main Oct 18, 2026
1 check passed
@Adammatthiesen
Adammatthiesen deleted the more-security branch October 18, 2026 05:58
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