mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Allow creating a local suspension when only the global permission is set
This commit is contained in:
parent
0025fc63ee
commit
c82eea234f
@ -91,7 +91,9 @@ public function checkPermission() {
|
||||
|
||||
$this->room = $this->commandHandler->getRoom();
|
||||
$ph = new \chat\system\permission\PermissionHandler();
|
||||
if (!$ph->getPermission($this->room, 'mod.can'.ucfirst((static::IS_GLOBAL ? 'g' : '').static::SUSPENSION_TYPE))) throw new \wcf\system\exception\PermissionDeniedException();
|
||||
if (!$ph->getPermission($this->room, 'mod.can'.ucfirst((static::IS_GLOBAL ? 'g' : '').static::SUSPENSION_TYPE)) && $ph->getPermission($this->room, 'mod.canG'.static::SUSPENSION_TYPE)) {
|
||||
throw new \wcf\system\exception\PermissionDeniedException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,10 +57,12 @@ public function executeAction() {
|
||||
*/
|
||||
public function checkPermission() {
|
||||
parent::checkPermission();
|
||||
|
||||
|
||||
$this->room = $this->commandHandler->getRoom();
|
||||
$ph = new \chat\system\permission\PermissionHandler();
|
||||
if (!$ph->getPermission($this->room, 'mod.can'.ucfirst((static::IS_GLOBAL ? 'g' : '').static::SUSPENSION_TYPE))) throw new \wcf\system\exception\PermissionDeniedException();
|
||||
if (!$ph->getPermission($this->room, 'mod.can'.ucfirst((static::IS_GLOBAL ? 'g' : '').static::SUSPENSION_TYPE)) && $ph->getPermission($this->room, 'mod.canG'.static::SUSPENSION_TYPE)) {
|
||||
throw new \wcf\system\exception\PermissionDeniedException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user