Make user auth rank checks case insensitive

This commit is contained in:
Colin McDonald 2016-05-15 17:43:41 -04:00
parent 85dfedfa6f
commit 26db4bb255

View File

@ -9,7 +9,7 @@ import java.util.Set;
public final class UserActor implements Actor {
private static final Set<String> permittedUserRanks = ImmutableSet.copyOf(APIv3.getConfig().getProperty("auth.permittedUserRanks").split(","));
private static final Set<String> permittedUserRanks = ImmutableSet.copyOf(APIv3.getConfig().getProperty("auth.permittedUserRanks").toLowerCase().split(","));
@Getter private final User user;
// We use Boolean here so we can have null = not calculated;
@ -24,7 +24,7 @@ public final class UserActor implements Actor {
return cachedAuthorized;
} else {
String highestRankId = user.getHighestRank().getId();
cachedAuthorized = permittedUserRanks.contains(highestRankId);
cachedAuthorized = permittedUserRanks.contains(highestRankId.toLowerCase());
return cachedAuthorized;
}
}