diff --git a/common/src/main/java/net/william278/husksync/command/EnderChestCommand.java b/common/src/main/java/net/william278/husksync/command/EnderChestCommand.java index 239430c0..5d1bc27c 100644 --- a/common/src/main/java/net/william278/husksync/command/EnderChestCommand.java +++ b/common/src/main/java/net/william278/husksync/command/EnderChestCommand.java @@ -46,9 +46,10 @@ public class EnderChestCommand extends CommandBase implements TabCompletable { "/enderchest [version_uuid]").ifPresent(player::sendMessage); } } else { - // View latest user data + // View (and edit) the latest user data plugin.getDatabase().getCurrentUserData(user).thenAccept(optionalData -> optionalData.ifPresentOrElse( - versionedUserData -> showEnderChestMenu(player, versionedUserData, user, true), + versionedUserData -> showEnderChestMenu(player, versionedUserData, user, + player.hasPermission(Permission.COMMAND_ENDER_CHEST_EDIT.node)), () -> plugin.getLocales().getLocale("error_no_data_to_display") .ifPresent(player::sendMessage))); } diff --git a/common/src/main/java/net/william278/husksync/command/InventoryCommand.java b/common/src/main/java/net/william278/husksync/command/InventoryCommand.java index acb23769..52131b17 100644 --- a/common/src/main/java/net/william278/husksync/command/InventoryCommand.java +++ b/common/src/main/java/net/william278/husksync/command/InventoryCommand.java @@ -46,9 +46,10 @@ public class InventoryCommand extends CommandBase implements TabCompletable { "/inventory [version_uuid]").ifPresent(player::sendMessage); } } else { - // View latest user data + // View (and edit) the latest user data plugin.getDatabase().getCurrentUserData(user).thenAccept(optionalData -> optionalData.ifPresentOrElse( - versionedUserData -> showInventoryMenu(player, versionedUserData, user, true), + versionedUserData -> showInventoryMenu(player, versionedUserData, user, + player.hasPermission(Permission.COMMAND_INVENTORY_EDIT.node)), () -> plugin.getLocales().getLocale("error_no_data_to_display") .ifPresent(player::sendMessage))); }