mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-01-01 05:57:51 +01:00
Fix vault primary group override feature
This commit is contained in:
parent
5ebbc178a5
commit
6cd8593fa5
@ -376,7 +376,7 @@ public class VaultPermissionHook extends Permission {
|
||||
}
|
||||
|
||||
if (pgoCheckMemberOf) {
|
||||
if (!user.getLocalGroups(server, world).contains(group.toLowerCase())) {
|
||||
if (!user.getLocalGroups(server, world, isIncludeGlobal()).contains(group.toLowerCase())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -890,6 +890,15 @@ public abstract class PermissionHolder {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<String> getLocalGroups(String server, String world, boolean includeGlobal) {
|
||||
return getNodes().stream()
|
||||
.filter(Node::isGroupNode)
|
||||
.filter(n -> n.shouldApplyOnWorld(world, includeGlobal, true))
|
||||
.filter(n -> n.shouldApplyOnServer(server, includeGlobal, true))
|
||||
.map(Node::getGroupName)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a {@link List} of the groups the holder inherits on a specific server
|
||||
* @param server the server to check
|
||||
|
Loading…
Reference in New Issue
Block a user