Partially implement PermissionService

This commit is contained in:
Luck
2016-08-25 17:23:27 +01:00
Unverified
parent de5fda6a18
commit 44d14001e1
8 changed files with 811 additions and 0 deletions
@@ -44,6 +44,7 @@ public class Patterns {
public static final Pattern NON_USERNAME = Pattern.compile("[^A-Za-z0-9_]");
public static final Pattern SHORTHAND_NODE = Pattern.compile("\\.\\([^.]+\\)");
public static final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + String.valueOf('§') + "[0-9A-FK-OR]");
public static final Pattern NODE_CONTEXTS = Pattern.compile("\\(.+\\).*");
public static Pattern compile(String regex) throws PatternSyntaxException {
if (!CACHE.containsKey(regex)) {
@@ -815,6 +815,7 @@ public abstract class PermissionHolder {
return input;
}
// TODO Support the "Sponge way" of doing wildcards
private static Map<String, Boolean> applyWildcards(Map<String, Boolean> input, List<String> possibleNodes) {
SortedMap<Integer, Map<String, Boolean>> wildcards = new TreeMap<>(Collections.reverseOrder());
for (Map.Entry<String, Boolean> e : input.entrySet()) {