Skip to content

Commit d740f91

Browse files
authored
Enforce baltop permission (#88)
2 parents 087cc86 + 6308c46 commit d740f91

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/pro/cloudnode/smp/bankaccounts/commands/BaltopCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public boolean execute(final @NotNull CommandSender sender, final @NotNull Strin
3737
}
3838

3939
public static boolean run(final @NotNull CommandSender sender, final @NotNull String label, final @NotNull String @NotNull [] args, final @NotNull String @NotNull [] labelArgs) {
40+
if (!sender.hasPermission(Permissions.BALTOP)) return sendMessage(sender, BankAccounts.getInstance().config().messagesErrorsNoPermission());
4041
final @NotNull Optional<@NotNull String> type = args.length > 0 && (args[0].equalsIgnoreCase("personal") || args[0].equalsIgnoreCase("business") || args[0].equalsIgnoreCase("player")) ? Optional.of(args[0]) : Optional.empty();
4142
int page = (int) Math.min(1e9, (args.length == 1 && type.isEmpty() && isInteger(args[0])) ? Integer.parseInt(args[0]) : ((args.length > 1 && isInteger(args[1])) ? Integer.parseInt(args[1]) : 1));
4243
if (page < 1) page = 1;

0 commit comments

Comments
 (0)