restrict access to the all transactions menu by permission (can be toggled)

This commit is contained in:
Kiran Hart 2021-12-14 14:40:51 -05:00
parent 96830d5ac8
commit 8996e03c8b

View File

@ -27,6 +27,11 @@ public final class GUITransactionType extends Gui {
private void draw() {
setButton(11, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_ITEM.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_NAME.getString(), Settings.GUI_TRANSACTIONS_TYPE_ITEMS_ALL_TRANSACTIONS_LORE.getStringList(), null), e -> {
if (Settings.RESTRICT_ALL_TRANSACTIONS_TO_PERM.getBoolean() && !e.player.hasPermission("auctionhouse.transactions.viewall")) {
AuctionHouse.getInstance().getLocale().getMessage("commands.no_permission").sendPrefixedMessage(e.player);
return;
}
e.manager.showGUI(e.player, new GUITransactionList(e.player, true));
});