mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Remove deprecated permissions
This commit is contained in:
parent
d37841c214
commit
133884da72
@ -34,17 +34,13 @@ final class DefaultPermissionNames{
|
||||
public const COMMAND_DEFAULTGAMEMODE = "pocketmine.command.defaultgamemode";
|
||||
public const COMMAND_DIFFICULTY = "pocketmine.command.difficulty";
|
||||
public const COMMAND_DUMPMEMORY = "pocketmine.command.dumpmemory";
|
||||
public const COMMAND_EFFECT = "pocketmine.command.effect";
|
||||
public const COMMAND_EFFECT_OTHER = "pocketmine.command.effect.other";
|
||||
public const COMMAND_EFFECT_SELF = "pocketmine.command.effect.self";
|
||||
public const COMMAND_ENCHANT = "pocketmine.command.enchant";
|
||||
public const COMMAND_ENCHANT_OTHER = "pocketmine.command.enchant.other";
|
||||
public const COMMAND_ENCHANT_SELF = "pocketmine.command.enchant.self";
|
||||
public const COMMAND_GAMEMODE = "pocketmine.command.gamemode";
|
||||
public const COMMAND_GAMEMODE_OTHER = "pocketmine.command.gamemode.other";
|
||||
public const COMMAND_GAMEMODE_SELF = "pocketmine.command.gamemode.self";
|
||||
public const COMMAND_GC = "pocketmine.command.gc";
|
||||
public const COMMAND_GIVE = "pocketmine.command.give";
|
||||
public const COMMAND_GIVE_OTHER = "pocketmine.command.give.other";
|
||||
public const COMMAND_GIVE_SELF = "pocketmine.command.give.self";
|
||||
public const COMMAND_HELP = "pocketmine.command.help";
|
||||
@ -63,12 +59,10 @@ final class DefaultPermissionNames{
|
||||
public const COMMAND_SAY = "pocketmine.command.say";
|
||||
public const COMMAND_SEED = "pocketmine.command.seed";
|
||||
public const COMMAND_SETWORLDSPAWN = "pocketmine.command.setworldspawn";
|
||||
public const COMMAND_SPAWNPOINT = "pocketmine.command.spawnpoint";
|
||||
public const COMMAND_SPAWNPOINT_OTHER = "pocketmine.command.spawnpoint.other";
|
||||
public const COMMAND_SPAWNPOINT_SELF = "pocketmine.command.spawnpoint.self";
|
||||
public const COMMAND_STATUS = "pocketmine.command.status";
|
||||
public const COMMAND_STOP = "pocketmine.command.stop";
|
||||
public const COMMAND_TELEPORT = "pocketmine.command.teleport";
|
||||
public const COMMAND_TELEPORT_OTHER = "pocketmine.command.teleport.other";
|
||||
public const COMMAND_TELEPORT_SELF = "pocketmine.command.teleport.self";
|
||||
public const COMMAND_TELL = "pocketmine.command.tell";
|
||||
@ -78,7 +72,6 @@ final class DefaultPermissionNames{
|
||||
public const COMMAND_TIME_START = "pocketmine.command.time.start";
|
||||
public const COMMAND_TIME_STOP = "pocketmine.command.time.stop";
|
||||
public const COMMAND_TIMINGS = "pocketmine.command.timings";
|
||||
public const COMMAND_TITLE = "pocketmine.command.title";
|
||||
public const COMMAND_TITLE_OTHER = "pocketmine.command.title.other";
|
||||
public const COMMAND_TITLE_SELF = "pocketmine.command.title.self";
|
||||
public const COMMAND_TRANSFERSERVER = "pocketmine.command.transferserver";
|
||||
|
@ -44,12 +44,6 @@ abstract class DefaultPermissions{
|
||||
return PermissionManager::getInstance()->getPermission($candidate->getName());
|
||||
}
|
||||
|
||||
private static function registerDeprecatedPermission(string $name) : Permission{
|
||||
$permission = new Permission($name, "Deprecated, kept for backwards compatibility only");
|
||||
PermissionManager::getInstance()->addPermission($permission);
|
||||
return $permission;
|
||||
}
|
||||
|
||||
public static function registerCorePermissions() : void{
|
||||
$consoleRoot = self::registerPermission(new Permission(self::ROOT_CONSOLE, "Grants all console permissions"));
|
||||
$operatorRoot = self::registerPermission(new Permission(self::ROOT_OPERATOR, "Grants all operator permissions"), [$consoleRoot]);
|
||||
@ -65,25 +59,15 @@ abstract class DefaultPermissions{
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_DEFAULTGAMEMODE, "Allows the user to change the default gamemode"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_DIFFICULTY, "Allows the user to change the game difficulty"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_DUMPMEMORY, "Allows the user to dump memory contents"), [$consoleRoot]);
|
||||
|
||||
$effectRoot = self::registerDeprecatedPermission(DefaultPermissionNames::COMMAND_EFFECT);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_EFFECT_OTHER, "Allows the user to modify effects of other players"), [$operatorRoot, $effectRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_EFFECT_SELF, "Allows the user to modify their own effects"), [$operatorRoot, $effectRoot]);
|
||||
|
||||
$enchantRoot = self::registerDeprecatedPermission(DefaultPermissionNames::COMMAND_ENCHANT);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_ENCHANT_OTHER, "Allows the user to enchant the held items of other players"), [$operatorRoot, $enchantRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_ENCHANT_SELF, "Allows the user to enchant their own held item"), [$operatorRoot, $enchantRoot]);
|
||||
|
||||
$gameModeRoot = self::registerDeprecatedPermission(DefaultPermissionNames::COMMAND_GAMEMODE);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GAMEMODE_OTHER, "Allows the user to change the game mode of other players"), [$operatorRoot, $gameModeRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GAMEMODE_SELF, "Allows the user to change their own game mode"), [$operatorRoot, $gameModeRoot]);
|
||||
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_EFFECT_OTHER, "Allows the user to modify effects of other players"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_EFFECT_SELF, "Allows the user to modify their own effects"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_ENCHANT_OTHER, "Allows the user to enchant the held items of other players"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_ENCHANT_SELF, "Allows the user to enchant their own held item"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GAMEMODE_OTHER, "Allows the user to change the game mode of other players"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GAMEMODE_SELF, "Allows the user to change their own game mode"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GC, "Allows the user to fire garbage collection tasks"), [$operatorRoot]);
|
||||
|
||||
$giveRoot = self::registerDeprecatedPermission(DefaultPermissionNames::COMMAND_GIVE);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GIVE_OTHER, "Allows the user to give items to other players"), [$operatorRoot, $giveRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GIVE_SELF, "Allows the user to give items to themselves"), [$operatorRoot, $giveRoot]);
|
||||
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GIVE_OTHER, "Allows the user to give items to other players"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_GIVE_SELF, "Allows the user to give items to themselves"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_HELP, "Allows the user to view the help menu"), [$everyoneRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_KICK, "Allows the user to kick players"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_KILL_OTHER, "Allows the user to kill other players"), [$operatorRoot]);
|
||||
@ -100,18 +84,12 @@ abstract class DefaultPermissions{
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_SAY, "Allows the user to talk as the console"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_SEED, "Allows the user to view the seed of the world"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_SETWORLDSPAWN, "Allows the user to change the world spawn"), [$operatorRoot]);
|
||||
|
||||
$spawnpointRoot = self::registerDeprecatedPermission(DefaultPermissionNames::COMMAND_SPAWNPOINT);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_SPAWNPOINT_OTHER, "Allows the user to change the respawn point of other players"), [$operatorRoot, $spawnpointRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_SPAWNPOINT_SELF, "Allows the user to change their own respawn point"), [$operatorRoot, $spawnpointRoot]);
|
||||
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_SPAWNPOINT_OTHER, "Allows the user to change the respawn point of other players"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_SPAWNPOINT_SELF, "Allows the user to change their own respawn point"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_STATUS, "Allows the user to view the server performance"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_STOP, "Allows the user to stop the server"), [$operatorRoot]);
|
||||
|
||||
$teleportRoot = self::registerDeprecatedPermission(DefaultPermissionNames::COMMAND_TELEPORT);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TELEPORT_OTHER, "Allows the user to teleport other players"), [$operatorRoot, $teleportRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TELEPORT_SELF, "Allows the user to teleport themselves"), [$operatorRoot, $teleportRoot]);
|
||||
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TELEPORT_OTHER, "Allows the user to teleport other players"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TELEPORT_SELF, "Allows the user to teleport themselves"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TELL, "Allows the user to privately message another player"), [$everyoneRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TIME_ADD, "Allows the user to fast-forward time"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TIME_QUERY, "Allows the user query the time"), [$operatorRoot]);
|
||||
@ -119,11 +97,8 @@ abstract class DefaultPermissions{
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TIME_START, "Allows the user to restart the time"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TIME_STOP, "Allows the user to stop the time"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TIMINGS, "Allows the user to record timings to analyse server performance"), [$operatorRoot]);
|
||||
|
||||
$titleRoot = self::registerDeprecatedPermission(DefaultPermissionNames::COMMAND_TITLE);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TITLE_OTHER, "Allows the user to send a title to the specified player"), [$operatorRoot, $titleRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TITLE_SELF, "Allows the user to send a title to themselves"), [$operatorRoot, $titleRoot]);
|
||||
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TITLE_OTHER, "Allows the user to send a title to the specified player"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TITLE_SELF, "Allows the user to send a title to themselves"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_TRANSFERSERVER, "Allows the user to transfer self to another server"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_UNBAN_IP, "Allows the user to unban IP addresses"), [$operatorRoot]);
|
||||
self::registerPermission(new Permission(DefaultPermissionNames::COMMAND_UNBAN_PLAYER, "Allows the user to unban players"), [$operatorRoot]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user