apply group rewrites to vault - resolves #59

This commit is contained in:
Luck 2016-12-07 21:18:57 +00:00
parent 1c97cb3cec
commit 2fba9b83af
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -248,8 +248,7 @@ public class VaultPermissionHook extends Permission {
.filter(n -> n.shouldApplyOnServer(server, isIncludeGlobal(), false))
.filter(n -> n.shouldApplyOnWorld(finalWorld, true, false))
.map(Node::getGroupName)
.filter(s -> s.equalsIgnoreCase(group))
.findAny().isPresent();
.anyMatch(s -> s.equalsIgnoreCase(group));
}
@Override
@ -329,7 +328,8 @@ public class VaultPermissionHook extends Permission {
}
if (!pgo) {
return user.getPrimaryGroup();
String g = user.getPrimaryGroup();
return plugin.getConfiguration().getGroupNameRewrites().getOrDefault(g, g);
}
if (pgoCheckInherited) {
@ -394,7 +394,8 @@ public class VaultPermissionHook extends Permission {
}
// Fallback
return user.getPrimaryGroup();
String g = user.getPrimaryGroup();
return plugin.getConfiguration().getGroupNameRewrites().getOrDefault(g, g);
}
@Override