Improve permission checking for chat broadcast subscribers #6516
Labels
BC break
Breaks API compatibility
Category: API
Related to the plugin API
Opinions Wanted
Request for comments & opinions from the community
Type: Enhancement
Contributes features or other improvements to PocketMine-MP
Description
Currently, the chat broadcast system relies on each recipient to do permission checks.
This is currently done in
Player
in a very janky way by (un)subscribing to the needed channels when permissions are updated.This proposes that:
CommandSender
can subscribe to a broadcast channel, irrespective of permissionsbroadcastMessage()
should check if the subscriber has the permission associated with the channel in questionJustification
More consistent behaviour. If more types of
CommandSender
are added by plugins (e.g. RCON) and subscribed to these channels, their permissions won't be enforced, which could lead to data being leaked. This is sort of similar to the easy security issues caused by having commands check their own permissions rather than the server doing it.Alternative methods
The text was updated successfully, but these errors were encountered: