Altay
Running a server

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 YourGamertag

Operators 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:

NodeWhat it covers
pocketmine.command.*Every built in command.
pocketmine.command.opGranting and removing operator status.
pocketmine.command.gamemodeChanging gamemodes.
pocketmine.command.teleporttp and friends.
pocketmine.command.ban and .kickModeration.
pocketmine.command.whitelistWhitelist management.
pocketmine.group.userThe default group every player starts in.
pocketmine.group.operatorThe 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: op

default 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.

On this page