Fix: permission check for integer flags (#4217)

* Changing numeric check to support '0'

* Adding notes

* More detailed description of 'max-plots' setting
This commit is contained in:
RedstoneFuture
2023-11-21 18:26:15 +01:00
committed by GitHub
parent be6838f29e
commit ba7880241b
4 changed files with 8 additions and 2 deletions

View File

@ -158,6 +158,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
}
final String[] nodes = stub.split("\\.");
final StringBuilder n = new StringBuilder();
// Wildcard check from less specific permission to more specific permission
for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i]).append(".");
if (!stub.equals(n + Permission.PERMISSION_STAR.toString())) {
@ -166,9 +167,11 @@ public class BukkitPlayer extends PlotPlayer<Player> {
}
}
}
// Wildcard check for the full permission
if (hasPermission(stub + ".*")) {
return Integer.MAX_VALUE;
}
// Permission value cache for iterative check
int max = 0;
if (CHECK_EFFECTIVE) {
boolean hasAny = false;