Skip to content

Commit

Permalink
Enforce baltop permission (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
zefir-git authored Jan 16, 2024
2 parents 087cc86 + 6308c46 commit d740f91
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public boolean execute(final @NotNull CommandSender sender, final @NotNull Strin
}

public static boolean run(final @NotNull CommandSender sender, final @NotNull String label, final @NotNull String @NotNull [] args, final @NotNull String @NotNull [] labelArgs) {
if (!sender.hasPermission(Permissions.BALTOP)) return sendMessage(sender, BankAccounts.getInstance().config().messagesErrorsNoPermission());
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();
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));
if (page < 1) page = 1;
Expand Down

0 comments on commit d740f91

Please sign in to comment.