Open dktapps opened 3 months ago
This would also be useful for backwards compatibility purposes. Currently, if we want to divide an existing permission into sub permissions, the original permission declaration has to be explicitly retained, as seen here: https://github.com/pmmp/PocketMine-MP/commit/567bd8abb5dfbd4a035a081663cba820f45887e7#diff-28f7c5edac5d9f0ad9a1eabb7aada678eb60c4d2f8ca5da16a68acad45fb724c
This shouldn't be necessary, as the "deprecated" permission should be auto declared.
Description
Currently, the permission system doesn't make any assumptions about the strings used to identify permissions. However, in practice, permissions typically look like this:
pocketmine.command.gamemode.self
However, if trying to set the permission
pocketmine.command.gamemode
to override all of the sub permissions, nothing will happen.This issue proposes that
.
should be considered as a hierarchy separator by the internal system, and parent permission nodes automatically declared to allow users to get the expected behaviour.This means that registering
pocketmine.command.gamemode.self
would generate the following hierarchy:Alternative methods