mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 10:49:10 +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{
|
||||
if($parent instanceof Permission){
|
||||
$parent->getChildren()[$perm->getName()] = true;
|
||||
$parent->addChild($perm->getName(), true);
|
||||
}
|
||||
PermissionManager::getInstance()->addPermission($perm);
|
||||
|
||||
|
@ -116,4 +116,9 @@ class Permission{
|
||||
$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