mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Do not mutate the result of Permission->getChildren()
This commit is contained in:
parent
f0e43a6b22
commit
3849756993
@ -28,7 +28,7 @@ abstract class DefaultPermissions{
|
|||||||
|
|
||||||
public static function registerPermission(Permission $perm, ?Permission $parent = null) : Permission{
|
public static function registerPermission(Permission $perm, ?Permission $parent = null) : Permission{
|
||||||
if($parent instanceof Permission){
|
if($parent instanceof Permission){
|
||||||
$parent->getChildren()[$perm->getName()] = true;
|
$parent->addChild($perm->getName(), true);
|
||||||
}
|
}
|
||||||
PermissionManager::getInstance()->addPermission($perm);
|
PermissionManager::getInstance()->addPermission($perm);
|
||||||
|
|
||||||
|
@ -116,4 +116,9 @@ class Permission{
|
|||||||
$p->recalculatePermissions();
|
$p->recalculatePermissions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addChild(string $name, bool $value) : void{
|
||||||
|
$this->children[$name] = $value;
|
||||||
|
$this->recalculatePermissibles();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user