@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations != null) { List<String> labels = authorizations.getLabels(); String userName = user.getShortName(); Set<String> auths = new HashSet<>(); auths.addAll(this.labelsCache.getUserAuths(userName)); auths.addAll(this.labelsCache.getGroupAuths(user.getGroupNames())); return dropLabelsNotInUserAuths(labels, new ArrayList<>(auths), userName); } return null; }
@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations != null) { List<String> labels = authorizations.getLabels(); String userName = user.getShortName(); Set<String> auths = new HashSet<String>(); auths.addAll(this.labelsCache.getUserAuths(userName)); auths.addAll(this.labelsCache.getGroupAuths(user.getGroupNames())); return dropLabelsNotInUserAuths(labels, new ArrayList<String>(auths), userName); } return null; }