mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-03 17:39:31 +01:00
Ensure child permissions are handled as lowercase when resolving (#2761)
This commit is contained in:
parent
e6a5cb06af
commit
16fbf566f3
@ -180,16 +180,18 @@ public final class LuckPermsPermissionMap extends ForwardingMap<String, Permissi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accumulator.containsKey(e.getKey())) {
|
String key = e.getKey().toLowerCase();
|
||||||
|
|
||||||
|
if (accumulator.containsKey(key)) {
|
||||||
continue; // Prevent infinite loops
|
continue; // Prevent infinite loops
|
||||||
}
|
}
|
||||||
|
|
||||||
// xor the value using the parent (bukkit logic, not mine)
|
// xor the value using the parent (bukkit logic, not mine)
|
||||||
boolean value = e.getValue() ^ invert;
|
boolean value = e.getValue() ^ invert;
|
||||||
accumulator.put(e.getKey().toLowerCase(), value);
|
accumulator.put(key, value);
|
||||||
|
|
||||||
// lookup any deeper children & resolve if present
|
// lookup any deeper children & resolve if present
|
||||||
Permission perm = this.delegate.get(e.getKey());
|
Permission perm = this.delegate.get(key);
|
||||||
if (perm != null) {
|
if (perm != null) {
|
||||||
resolveChildren(accumulator, perm.getChildren(), !value);
|
resolveChildren(accumulator, perm.getChildren(), !value);
|
||||||
}
|
}
|
||||||
|
@ -180,16 +180,18 @@ public final class LuckPermsPermissionMap extends ForwardingMap<String, Permissi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accumulator.containsKey(e.getKey())) {
|
String key = e.getKey().toLowerCase();
|
||||||
|
|
||||||
|
if (accumulator.containsKey(key)) {
|
||||||
continue; // Prevent infinite loops
|
continue; // Prevent infinite loops
|
||||||
}
|
}
|
||||||
|
|
||||||
// xor the value using the parent (nukkit logic, not mine)
|
// xor the value using the parent (nukkit logic, not mine)
|
||||||
boolean value = e.getValue() ^ invert;
|
boolean value = e.getValue() ^ invert;
|
||||||
accumulator.put(e.getKey().toLowerCase(), value);
|
accumulator.put(key, value);
|
||||||
|
|
||||||
// lookup any deeper children & resolve if present
|
// lookup any deeper children & resolve if present
|
||||||
Permission perm = this.delegate.get(e.getKey());
|
Permission perm = this.delegate.get(key);
|
||||||
if (perm != null) {
|
if (perm != null) {
|
||||||
resolveChildren(accumulator, perm.getChildren(), !value);
|
resolveChildren(accumulator, perm.getChildren(), !value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user