Improved permission handling for "inventory" and "item" actions

This commit is contained in:
Intelli 2022-02-10 17:32:11 -07:00
parent 02afc6c530
commit cd8ef0d273
2 changed files with 8 additions and 4 deletions

View File

@ -209,7 +209,7 @@ public class LookupCommand {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
return;
}
if (argAction.contains(4) && !player.hasPermission("coreprotect.lookup.container")) {
if (argAction.contains(4) && !argAction.contains(11) && !player.hasPermission("coreprotect.lookup.container")) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
return;
}
@ -233,7 +233,11 @@ public class LookupCommand {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
return;
}
if (argAction.contains(11) && (!player.hasPermission("coreprotect.lookup.inventory") || !player.hasPermission("coreprotect.lookup.item"))) {
if (argAction.contains(11) && !argAction.contains(4) && !player.hasPermission("coreprotect.lookup.item")) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
return;
}
if (argAction.contains(4) && argAction.contains(11) && !player.hasPermission("coreprotect.lookup.inventory")) {
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.NO_PERMISSION));
return;
}

View File

@ -106,8 +106,8 @@ permissions:
description: Has permission to lookup inventory transactions
default: op
coreprotect.lookup.item:
description: Has permission to lookup inventory transactions (deprecated)
default: true
description: Has permission to lookup item transactions
default: op
coreprotect.lookup.kill:
description: Has permission to lookup entity kills
default: op