mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Merge branch 'release/3.3'
This commit is contained in:
commit
932705e114
@ -166,9 +166,7 @@ class PermissibleBase implements Permissible{
|
|||||||
|
|
||||||
public function clearPermissions(){
|
public function clearPermissions(){
|
||||||
$permManager = PermissionManager::getInstance();
|
$permManager = PermissionManager::getInstance();
|
||||||
foreach(array_keys($this->permissions) as $name){
|
$permManager->unsubscribeFromAllPermissions($this->parent ?? $this);
|
||||||
$permManager->unsubscribeFromPermission($name, $this->parent ?? $this);
|
|
||||||
}
|
|
||||||
|
|
||||||
$permManager->unsubscribeFromDefaultPerms(false, $this->parent ?? $this);
|
$permManager->unsubscribeFromDefaultPerms(false, $this->parent ?? $this);
|
||||||
$permManager->unsubscribeFromDefaultPerms(true, $this->parent ?? $this);
|
$permManager->unsubscribeFromDefaultPerms(true, $this->parent ?? $this);
|
||||||
|
@ -160,6 +160,18 @@ class PermissionManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Permissible $permissible
|
||||||
|
*/
|
||||||
|
public function unsubscribeFromAllPermissions(Permissible $permissible) : void{
|
||||||
|
foreach($this->permSubs as $permission => &$subs){
|
||||||
|
unset($subs[spl_object_hash($permissible)]);
|
||||||
|
if(empty($subs)){
|
||||||
|
unset($this->permSubs[$permission]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $permission
|
* @param string $permission
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user