Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Fix other erroneous exemption checks on commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dualspiral committed Sep 25, 2020
1 parent 8c107f4 commit 5742c3d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelogs/templates/2.1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ For the things YOU need to do as a server owner, [please visit our instructions

# Bug Fixes

* None yet
* Fix `/ban`, `/tempban`, `/jail` and `/mute` erroneously telling users that targets were exempt when they were not.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public CommandElement[] parameters(INucleusServiceCollection serviceCollection)
String reason = context.getOne(NucleusParameters.Keys.REASON, String.class)
.orElseGet(() -> context.getServiceCollection().messageProvider().getMessageString(context.getCommandSourceUnchecked(), "ban.defaultreason"));

if (!(context.isConsoleAndBypass() || context.testPermissionFor(u, BanPermissions.TEMPBAN_EXEMPT_TARGET))) {
if (!context.isConsoleAndBypass() && context.testPermissionFor(u, BanPermissions.TEMPBAN_EXEMPT_TARGET)) {
return context.errorResult("command.tempban.exempt", u.getName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public CommandElement[] parameters(INucleusServiceCollection serviceCollection)
return context.errorResult("command.jail.alreadyjailed", pl.getName());
}

if (!context.isConsoleAndBypass() && context.testPermission(JailPermissions.JAIL_EXEMPT_TARGET)) {
if (!context.isConsoleAndBypass() && context.testPermissionFor(pl, JailPermissions.JAIL_EXEMPT_TARGET)) {
return context.errorResult("command.jail.exempt", pl.getName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public CommandElement[] parameters(INucleusServiceCollection serviceCollection)
Optional<MuteData> omd = handler.getPlayerMuteData(user);
Optional<String> reas = context.getOne(NucleusParameters.Keys.REASON, String.class);

if (!context.isConsoleAndBypass() && context.testPermission(MutePermissions.MUTE_EXEMPT_TARGET)) {
if (!context.isConsoleAndBypass() && context.testPermissionFor(user, MutePermissions.MUTE_EXEMPT_TARGET)) {
return context.errorResult("command.mute.exempt", user.getName());
}

Expand Down

0 comments on commit 5742c3d

Please sign in to comment.