mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Added PermissionAttachment::unsetPermissions(), PermissionAttachment::clearPermissions()
This commit is contained in:
parent
0328b4c5f5
commit
78b4223795
@ -66,7 +66,6 @@ interface Permissible extends ServerOperator{
|
||||
public function recalculatePermissions();
|
||||
|
||||
/**
|
||||
* TODO: Check this
|
||||
* @return Permission[]
|
||||
*/
|
||||
public function getEffectivePermissions();
|
||||
|
@ -88,17 +88,34 @@ class PermissionAttachment{
|
||||
return $this->permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool[]
|
||||
*/
|
||||
public function clearPermissions(){
|
||||
$this->permissions = [];
|
||||
$this->permissible->recalculatePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @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[] $permissions
|
||||
*/
|
||||
public function unsetPermissions(array $permissions){
|
||||
foreach($permissions as $node){
|
||||
unset($this->permissions[$node]);
|
||||
}
|
||||
$this->permissible->recalculatePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|Permission $name
|
||||
* @param bool $value
|
||||
|
Loading…
x
Reference in New Issue
Block a user