fix: more intuitive limit permissions (#2233)

- immediately return limit if unlimited (limit combination take the "higher" value)
 - add fawe.limit.unlimited permission and it's an intuitive permission to give
Dieser Commit ist enthalten in:
Jordan 2023-05-20 19:32:38 +01:00 committet von GitHub
Ursprung 3a13c4aaa7
Commit 1b0fb9ed48
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -102,11 +102,10 @@ public class Settings extends Config {
public FaweLimit getLimit(Actor actor) {
FaweLimit limit;
if (actor.hasPermission("fawe.limit.*") || actor.hasPermission("fawe.bypass")) {
limit = FaweLimit.MAX.copy();
} else {
limit = new FaweLimit();
if (actor.hasPermission("fawe.bypass") || actor.hasPermission("fawe.limit.unlimited")) {
return FaweLimit.MAX.copy();
}
limit = new FaweLimit();
ArrayList<String> keys = new ArrayList<>(LIMITS.getSections());
if (keys.remove("default")) {
keys.add("default");