mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 10:31:51 +00:00
Added PermissionAttachment::setPermissions()
This allows bulk permission without recalculating the new permissions until all everything is set. Permission plugins that set a big amount of nodes may want to use this method.
This commit is contained in:
parent
4624dfb472
commit
0328b4c5f5
@ -88,6 +88,17 @@ class PermissionAttachment{
|
|||||||
return $this->permissions;
|
return $this->permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bool[] $permissions
|
||||||
|
*/
|
||||||
|
public function setPermissions(array $permissions){
|
||||||
|
$this->permissions = [];
|
||||||
|
foreach($permissions as $key => $value){
|
||||||
|
$this->permissions[$key] = (bool) $value;
|
||||||
|
}
|
||||||
|
$this->permissible->recalculatePermissions();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|Permission $name
|
* @param string|Permission $name
|
||||||
* @param bool $value
|
* @param bool $value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user