Complete refactor of permissions/nodes. progress towards 1.6

This commit is contained in:
Luck
2016-08-27 00:32:39 +01:00
Unverified
parent c4497db06c
commit edaf174ebf
33 changed files with 1477 additions and 800 deletions
@@ -288,7 +288,9 @@ public abstract class User extends PermissionHolder implements Identifiable<UUID
public void clearNodes() {
String defaultGroupNode = getPlugin().getConfiguration().getDefaultGroupNode();
getNodes().clear();
getNodes().put(defaultGroupNode, true);
try {
setPermission(defaultGroupNode, true);
} catch (ObjectAlreadyHasException ignored) {}
}
/**
@@ -328,7 +330,7 @@ public abstract class User extends PermissionHolder implements Identifiable<UUID
*/
private List<String> getGroups(String server, String world, boolean includeGlobal) {
// Call super #getPermissions method, and just sort through those
Map<String, Boolean> perms = getPermissions(server, world, null, includeGlobal, null);
Map<String, Boolean> perms = getPermissions(server, world, null, includeGlobal, null, true);
return perms.keySet().stream()
.filter(s -> Patterns.GROUP_MATCH.matcher(s).matches())
.map(s -> Patterns.DOT.split(s, 2)[1])