allow to remove rights to themself

This commit is contained in:
Beu 2023-08-14 18:16:58 +02:00
parent 0f55bff6c2
commit bff16f6441

View File

@ -154,7 +154,7 @@ class AuthCommands implements CommandListener, UsageInformationAble {
return; return;
} }
if ($target->authLevel >= AuthenticationManager::AUTH_LEVEL_MASTERADMIN) { if ($player !== $target && $target->authLevel >= AuthenticationManager::AUTH_LEVEL_MASTERADMIN) {
$this->maniaControl->getChat()->sendError('You cannot remove rights of a MasterAdmin!', $player); $this->maniaControl->getChat()->sendError('You cannot remove rights of a MasterAdmin!', $player);
return; return;
} }
@ -164,7 +164,7 @@ class AuthCommands implements CommandListener, UsageInformationAble {
return; return;
} }
if ($player->authLevel <= $target->authLevel) { if ($player !== $target && $player->authLevel <= $target->authLevel) {
$this->maniaControl->getChat()->sendError('You cannot remove rights of a higher privileged player!', $player); $this->maniaControl->getChat()->sendError('You cannot remove rights of a higher privileged player!', $player);
return; return;
} }