Skip to content

Commit

Permalink
PMMP permission system is crap. Fix .* perms not working
Browse files Browse the repository at this point in the history
  • Loading branch information
inxomnyaa committed Feb 4, 2020
1 parent c36cd04 commit 26d5ffd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
@@ -1,7 +1,7 @@
---
name: WarpUI
main: xenialdan\WarpUI\Loader
version: 3.2.0
version: 3.2.1
api: ["3.11"]
load: POSTWORLD
authors:
Expand Down
8 changes: 4 additions & 4 deletions src/xenialdan/WarpUI/Loader.php
Expand Up @@ -103,11 +103,11 @@ public function showWarpUI(Player $player): void
{
$form = new SimpleForm(TextFormat::DARK_PURPLE . "Warps", "Click to teleport to a warp");
foreach (Loader::getWarps() as $warp) {
if ($player->hasPermission("warpui.warp." . TextFormat::clean(strtolower($warp))))
if ($player->hasPermission("warpui.warp") or $player->hasPermission("warpui.warp.*") or $player->hasPermission("warpui.warp." . TextFormat::clean(strtolower($warp))))
$form->addButton(new Button($warp));
}
$form->setCallable(function (Player $player, $data) {
if ($player->hasPermission("warpui.warp." . TextFormat::clean(strtolower($data)))) {
if ($player->hasPermission("warpui.warp") or $player->hasPermission("warpui.warp.*") or $player->hasPermission("warpui.warp." . TextFormat::clean(strtolower($data)))) {
$location = Loader::getWarp($data);
if (!is_null($location)) $player->teleport($location);
else $player->sendMessage("Warp was not found. Please contact an administrator about this\nError: Warp not found\nWarpname: " . $data);
Expand All @@ -127,11 +127,11 @@ public function showWorldUI(Player $player): void
{
$form = new SimpleForm(TextFormat::DARK_PURPLE . "Worlds", "Click to teleport to a world");
foreach (self::getAllWorlds() as $world) {
if ($player->hasPermission("warpui.world." . TextFormat::clean(strtolower($world))))
if ($player->hasPermission("warpui.world") or $player->hasPermission("warpui.world.*") or $player->hasPermission("warpui.world." . TextFormat::clean(strtolower($world))))
$form->addButton(new Button($world));
}
$form->setCallable(function (Player $player, $data) {
if ($player->hasPermission("warpui.world." . TextFormat::clean(strtolower($data)))) {
if ($player->hasPermission("warpui.world") or $player->hasPermission("warpui.world.*") or $player->hasPermission("warpui.world." . TextFormat::clean(strtolower($data)))) {
Loader::getInstance()->getServer()->loadLevel($data);
$level = Loader::getInstance()->getServer()->getLevelByName($data);
if (!is_null($level)) {
Expand Down

0 comments on commit 26d5ffd

Please sign in to comment.