getGroup methods should not include inherited groups

This commit is contained in:
Luck committed 2016-08-29 22:03:10 +01:00
1 parent 75858c1555
commit 4b67913eee
2 files changed
+9 -5

No files matched your search

@@ -329,7 +329,9 @@ public abstract class User extends PermissionHolder implements Identifiable<UUID
*/
public List<String> getGroups(String server, String world, boolean includeGlobal) {
// Call super #getPermissions method, and just sort through those
return getAllNodesFiltered(server, world, Collections.emptyMap(), includeGlobal, true).stream()
return getNodes().stream()
.filter(n -> n.shouldApplyOnWorld(world, includeGlobal, true))
.filter(n -> n.shouldApplyOnServer(server, includeGlobal, true))
.filter(Node::isGroupNode)
.map(Node::getGroupName)
.collect(Collectors.toList());