Permissions
Operators, permission nodes, and where the server stops and a plugin starts.
The server ships a permission system. It does not ship a management interface for it: assigning permissions to groups of players is a plugin's job.
Operators
op YourGamertag
deop YourGamertagOperators get every permission under pocketmine.command.* plus the ability to build inside spawn
protection. On a small server, that is the whole permission story.
Why xbox-auth matters here
Operator status is stored against the player's name. With authentication off, anyone can connect claiming your gamertag and inherit it.
Permission nodes
A node is a dotted string, and nodes nest. Granting pocketmine.command.gamemode allows the
gamemode command; granting the parent pocketmine.command allows every built in command.
Commonly used nodes:
| Node | What it covers |
|---|---|
pocketmine.command.* | Every built in command. |
pocketmine.command.op | Granting and removing operator status. |
pocketmine.command.gamemode | Changing gamemodes. |
pocketmine.command.teleport | tp and friends. |
pocketmine.command.ban and .kick | Moderation. |
pocketmine.command.whitelist | Whitelist management. |
pocketmine.group.user | The default group every player starts in. |
pocketmine.group.operator | The group operators are put in. |
Plugins register their own nodes the same way, declared in plugin.yml:
permissions:
greeter.command:
description: Allows using /greet
default: opdefault accepts true (everyone), false (nobody until granted), op and notop.
Checking a permission in code
if(!$player->hasPermission("greeter.command")){
$player->sendMessage("You cannot do that.");
return;
}Check permissions, not operator status
hasPermission() keeps working when a server owner swaps in a permission manager plugin.
isOp() does not.
Groups and ranks
For per group, per world or time limited permissions, install a permission manager plugin. The server exposes the attachment API those plugins use.
Two permission manager plugins installed at once fight over the same attachments and the result is whichever one ran last. Pick one.