Don't show negated group membership permissions in the output to 'user info' and 'group listmembers'

This commit is contained in:
Luck 2018-11-10 22:42:54 +00:00
parent 759ec5d499
commit 26973461e7
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 13 additions and 7 deletions

View File

@ -85,8 +85,13 @@ public class GroupListMembers extends SubCommand<Group> {
Message.SEARCH_SEARCHING_MEMBERS.send(sender, group.getName());
List<HeldPermission<UUID>> matchedUsers = plugin.getStorage().getUsersWithPermission(constraint).join();
List<HeldPermission<String>> matchedGroups = plugin.getStorage().getGroupsWithPermission(constraint).join();
List<HeldPermission<UUID>> matchedUsers = plugin.getStorage().getUsersWithPermission(constraint).join().stream()
.filter(HeldPermission::getValue)
.collect(Collectors.toList());
List<HeldPermission<String>> matchedGroups = plugin.getStorage().getGroupsWithPermission(constraint).join().stream()
.filter(HeldPermission::getValue)
.collect(Collectors.toList());
int users = matchedUsers.size();
int groups = matchedGroups.size();

View File

@ -47,7 +47,6 @@ import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.common.verbose.event.MetaCheckEvent;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
public class UserInfo extends SubCommand<User> {
@ -73,15 +72,17 @@ public class UserInfo extends SubCommand<User> {
user.getPrimaryGroup().getValue()
);
Set<Node> parents = user.enduringData().asSet().stream()
List<Node> parents = user.enduringData().asSortedSet().stream()
.filter(Node::isGroupNode)
.filter(Node::getValue)
.filter(Node::isPermanent)
.collect(Collectors.toSet());
.collect(Collectors.toList());
Set<Node> tempParents = user.enduringData().asSet().stream()
List<Node> tempParents = user.enduringData().asSortedSet().stream()
.filter(Node::isGroupNode)
.filter(Node::getValue)
.filter(Node::isTemporary)
.collect(Collectors.toSet());
.collect(Collectors.toList());
if (!parents.isEmpty()) {
Message.INFO_PARENT_HEADER.send(sender);