mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
PluginManager: fixed plugins being able to alter groups of other plugins' permissions
this could happen if a plugin declared a permission already declared by another plugin, and then declared a different default for it (e.g. true instead of op).
This commit is contained in:
parent
f81c55ce6c
commit
4cb6c7dc1e
@ -172,7 +172,9 @@ class PluginManager{
|
||||
$everyoneRoot = $permManager->getPermission(DefaultPermissions::ROOT_USER);
|
||||
foreach($description->getPermissions() as $default => $perms){
|
||||
foreach($perms as $perm){
|
||||
$permManager->addPermission($perm);
|
||||
if(!$permManager->addPermission($perm)){
|
||||
continue; //TODO: this should be reported as an error and prevent the plugin from loading
|
||||
}
|
||||
switch($default){
|
||||
case PermissionParser::DEFAULT_TRUE:
|
||||
$everyoneRoot->addChild($perm->getName(), true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user