Remove colour in permission checks.

As @supaham pointed out, this can cause issues with giving a player a wildcard permission and then negating the specific node if both nodes aren't negated.
This commit is contained in:
drtshock 2016-01-02 12:17:43 -08:00
parent 87842a36ba
commit a669163196
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ public class Commandnick extends EssentialsLoopCommand {
throw new Exception(tl("nickTooLong"));
} else if (FormatUtil.stripFormat(newNick).length() < 1) {
throw new Exception(tl("nickNamesAlpha"));
} else if (user != null && (user.isAuthorized("essentials.nick.changecolors") || user.isAuthorized("essentials.nick.changecolours")) && !FormatUtil.stripFormat(newNick).equals(user.getName())) {
} else if (user != null && (user.isAuthorized("essentials.nick.changecolors")) && !FormatUtil.stripFormat(newNick).equals(user.getName())) {
throw new Exception(tl("nickNamesOnlyColorChanges"));
}
return newNick;

View File

@ -68,7 +68,7 @@ public class FormatUtil {
return null;
}
String message;
if (user.isAuthorized(permBase + ".color") || user.isAuthorized(permBase + ".colour")) {
if (user.isAuthorized(permBase + ".color")) {
message = replaceColor(input, REPLACE_COLOR_PATTERN);
} else {
message = stripColor(input, VANILLA_COLOR_PATTERN);