-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: version command issues #6357
base: stable
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need translation follow up
just added english for now, pmmp/Language#182 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "detailed version" and the general "detail" wording is too vague. Be more specific - this is for restricting access to plugin versions.
Is there some suitable name for this?
|
First one seems the most obvious to me. Don't overthink it. |
that being said, those names look AI generated ... |
for the desc yes 😁 |
@@ -106,6 +106,7 @@ public static function registerCorePermissions() : void{ | |||
self::registerPermission(new Permission(Names::COMMAND_UNBAN_IP, l10n::pocketmine_permission_command_unban_ip()), [$operatorRoot]); | |||
self::registerPermission(new Permission(Names::COMMAND_UNBAN_PLAYER, l10n::pocketmine_permission_command_unban_player()), [$operatorRoot]); | |||
self::registerPermission(new Permission(Names::COMMAND_VERSION, l10n::pocketmine_permission_command_version()), [$everyoneRoot]); | |||
self::registerPermission(new Permission(Names::COMMAND_VERSION_PLUGINS, l10n::pocketmine_permission_command_version_plugins()), [$operatorRoot]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause problems for people who set pocketmine.command.version
expecting it to set this permission as well.
It's probably better to have:
pocketmine.command.version.server
pocketmine.command.version.plugins
and then have pocketmine.command.version
as a deprecated backwards-compatible group permission for the remainder of PM5. See how this was done for /effect
in PM4:
PocketMine-MP/src/permission/DefaultPermissions.php
Lines 71 to 73 in ba89ae5
$effectRoot = self::registerDeprecatedPermission(Names::COMMAND_EFFECT); | |
self::registerPermission(new Permission(Names::COMMAND_EFFECT_OTHER, "Allows the user to modify effects of other players"), [$operatorRoot, $effectRoot]); | |
self::registerPermission(new Permission(Names::COMMAND_EFFECT_SELF, "Allows the user to modify their own effects"), [$operatorRoot, $effectRoot]); |
This will permit people to still explicitly set pocketmine.command.version
to get the same functionality as it would previously, but since it won't be given to any groups, default functionality will be controlled by these new permissions.
(Side note for maintainers: If #6324 were implemented, explicitly registering deprecated group roots wouldn't be necessary anymore.)
Introduction
This pull request is to handle users using the version command for detailed things, such as checking plugin information.
Relevant issues
Fixes #6322
Changes
API changes
Added
DefaultPermissionNames::COMMAND_VERSION_DETAIL
-> Allows the user to view the detailed version of the server.Behavioural changes
Backwards compatibility
Follow-up
Tests
I tested this PR by doing the following (tick all that apply):
tests/phpunit
folder)