Make user auth rank checks case insensitive
This commit is contained in:
parent
85dfedfa6f
commit
26db4bb255
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user