Skip to content

Fix default minimum for permission requirements - #320

Merged
BlitzOffline merged 1 commit into
HelpChat:mainfrom
Pi1xl:fix/has-permissions-default-minimum
Nov 11, 2026
Merged

BlitzOffline merged 1 commit into
HelpChat:mainfrom
Pi1xl:fix/has-permissions-default-minimum

Conversation

@Pi1xl

@Pi1xl Pi1xl commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an issue where has permissions and !has permissions requirements always evaluate to true when minimum is omitted or set below 1.

According to both the wiki and the original PR introducing these requirements, the default behavior should be to check all listed permissions.

However, the configuration parser uses -1 as a sentinel for this behavior without resolving it before constructing HasPermissionsRequirement.

This causes both requirements to always pass when using the default minimum.

Changes

Resolve the sentinel to permissions.size() before constructing the requirement, restoring the documented behavior without affecting explicitly configured valid minimums.

References

@BlitzOffline

Copy link
Copy Markdown
Member

Good catch.

@BlitzOffline
BlitzOffline merged commit 1243082 into HelpChat:main Nov 11, 2026
Namnarak added a commit to CyoriaSMP-Team/DeluxeMenus-Folia that referenced this pull request Nov 12, 2026
Namnarak added a commit to CyoriaSMP-Team/DeluxeMenus-Folia that referenced this pull request Nov 12, 2026
Namnarak added a commit to CyoriaSMP-Team/DeluxeMenus-Folia that referenced this pull request Nov 12, 2026
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.

2 participants