mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-30 22:53:27 +01:00
getGroup methods should not include inherited groups
This commit is contained in:
parent
75858c1555
commit
4b67913eee
@ -26,6 +26,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import me.lucko.luckperms.LuckPermsPlugin;
|
import me.lucko.luckperms.LuckPermsPlugin;
|
||||||
|
import me.lucko.luckperms.api.Node;
|
||||||
import me.lucko.luckperms.api.event.events.GroupAddEvent;
|
import me.lucko.luckperms.api.event.events.GroupAddEvent;
|
||||||
import me.lucko.luckperms.api.implementation.internal.GroupLink;
|
import me.lucko.luckperms.api.implementation.internal.GroupLink;
|
||||||
import me.lucko.luckperms.api.implementation.internal.PermissionHolderLink;
|
import me.lucko.luckperms.api.implementation.internal.PermissionHolderLink;
|
||||||
@ -321,10 +322,11 @@ public class Group extends PermissionHolder implements Identifiable<String> {
|
|||||||
*/
|
*/
|
||||||
private List<String> getGroups(String server, String world, boolean includeGlobal) {
|
private List<String> getGroups(String server, String world, boolean includeGlobal) {
|
||||||
// Call super #getPermissions method, and just sort through those
|
// Call super #getPermissions method, and just sort through those
|
||||||
Map<String, Boolean> perms = exportNodes(server, world, null, includeGlobal, true, null);
|
return getNodes().stream()
|
||||||
return perms.keySet().stream()
|
.filter(n -> n.shouldApplyOnWorld(world, includeGlobal, true))
|
||||||
.filter(s -> Patterns.GROUP_MATCH.matcher(s).matches())
|
.filter(n -> n.shouldApplyOnServer(server, includeGlobal, true))
|
||||||
.map(s -> Patterns.DOT.split(s, 2)[1])
|
.filter(Node::isGroupNode)
|
||||||
|
.map(Node::getGroupName)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,9 @@ public abstract class User extends PermissionHolder implements Identifiable<UUID
|
|||||||
*/
|
*/
|
||||||
public List<String> getGroups(String server, String world, boolean includeGlobal) {
|
public List<String> getGroups(String server, String world, boolean includeGlobal) {
|
||||||
// Call super #getPermissions method, and just sort through those
|
// 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)
|
.filter(Node::isGroupNode)
|
||||||
.map(Node::getGroupName)
|
.map(Node::getGroupName)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
Loading…
Reference in New Issue
Block a user