Fix Permission Problem Trackmania Rounds Plugin

This commit is contained in:
kremsy 2017-10-16 15:23:45 +02:00
parent 6caa42029e
commit 6519216b90

View File

@ -21,7 +21,7 @@ class TrackmaniaRoundsPlugin implements Plugin, CommandListener {
* Constants * Constants
*/ */
const PLUGIN_ID = 6; const PLUGIN_ID = 6;
const PLUGIN_VERSION = 0.1; const PLUGIN_VERSION = 0.11;
const PLUGIN_NAME = 'Trackmania Rounds Plugin'; const PLUGIN_NAME = 'Trackmania Rounds Plugin';
const PLUGIN_AUTHOR = 'MCTeam'; const PLUGIN_AUTHOR = 'MCTeam';
@ -82,7 +82,7 @@ class TrackmaniaRoundsPlugin implements Plugin, CommandListener {
*/ */
public function commandSetPointsRepartition(array $chatCallback, Player $player) { public function commandSetPointsRepartition(array $chatCallback, Player $player) {
$permission = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_PERMISSION_TM_HANDLE_POINTS_REPARTITION); $permission = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_PERMISSION_TM_HANDLE_POINTS_REPARTITION);
if (!AuthenticationManager::checkRight($player, $permission)) { if (!AuthenticationManager::checkRight($player, AuthenticationManager::getAuthLevel($permission))) {
$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player); $this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
return; return;
} }
@ -121,7 +121,7 @@ class TrackmaniaRoundsPlugin implements Plugin, CommandListener {
*/ */
public function commandGetPointsRepartition(array $chatCallback, Player $player) { public function commandGetPointsRepartition(array $chatCallback, Player $player) {
$permission = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_PERMISSION_TM_HANDLE_POINTS_REPARTITION); $permission = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_PERMISSION_TM_HANDLE_POINTS_REPARTITION);
if (!AuthenticationManager::checkRight($player, $permission)) { if (!AuthenticationManager::checkRight($player, AuthenticationManager::getAuthLevel($permission))) {
$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player); $this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
return; return;
} }
@ -140,7 +140,7 @@ class TrackmaniaRoundsPlugin implements Plugin, CommandListener {
*/ */
public function commandTrackManiaEndRound(array $chatCallback, Player $player) { public function commandTrackManiaEndRound(array $chatCallback, Player $player) {
$permission = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_PERMISSION_END_ROUND); $permission = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_PERMISSION_END_ROUND);
if (!AuthenticationManager::checkRight($player, $permission)) { if (!AuthenticationManager::checkRight($player, AuthenticationManager::getAuthLevel($permission))) {
$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player); $this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
return; return;
} }