@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations != null) { return authorizations.getLabels(); } return null; } }
@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations == null || authorizations.getLabels() == null || authorizations.getLabels().isEmpty()) { String userName = user.getShortName(); Set<String> auths = new HashSet<>(); auths.addAll(this.labelsCache.getUserAuths(userName)); auths.addAll(this.labelsCache.getGroupAuths(user.getGroupNames())); return new ArrayList<>(auths); } return authorizations.getLabels(); }
@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations != null) { if (labelToFilter == null) return authorizations.getLabels(); List<String> newAuths = new ArrayList<>(); for (String auth : authorizations.getLabels()) { if (!labelToFilter.equals(auth)) newAuths.add(auth); } return newAuths; } 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<>(); auths.addAll(this.labelsCache.getUserAuths(userName)); auths.addAll(this.labelsCache.getGroupAuths(user.getGroupNames())); return dropLabelsNotInUserAuths(labels, new ArrayList<>(auths), userName); } return null; }
/** * Create a protocol buffer Authorizations based on a client Authorizations. * * @param authorizations * @return a protocol buffer Authorizations */ public static ClientProtos.Authorizations toAuthorizations(Authorizations authorizations) { ClientProtos.Authorizations.Builder builder = ClientProtos.Authorizations.newBuilder(); for (String label : authorizations.getLabels()) { builder.addLabel(label); } return builder.build(); }
if (authorizations != null) { TAuthorization tAuthorization = new TAuthorization(); tAuthorization.setLabels(authorizations.getLabels()); out.setAuthorizations(tAuthorization);
if (authorizations != null) { TAuthorization tAuthorization = new TAuthorization(); tAuthorization.setLabels(authorizations.getLabels()); out.setAuthorizations(tAuthorization);
List<String> labels = authorizations.getLabels(); for (String label : labels) { model.addLabel(label);
assertEquals(true, (scanWithLabels.getFilter() instanceof PrefixFilter)); assertEquals(0, Bytes.compareTo(((PrefixFilter) scanWithLabels.getFilter()).getPrefix(), Bytes.toBytesBinary(prefix))); assertEquals(2, scanWithLabels.getAuthorizations().getLabels().size()); assertEquals(label_0, scanWithLabels.getAuthorizations().getLabels().get(0)); assertEquals(label_1, scanWithLabels.getAuthorizations().getLabels().get(1));
/** * Create a protocol buffer Authorizations based on a client Authorizations. * * @param authorizations * @return a protocol buffer Authorizations */ public static ClientProtos.Authorizations toAuthorizations(Authorizations authorizations) { ClientProtos.Authorizations.Builder builder = ClientProtos.Authorizations.newBuilder(); for (String label : authorizations.getLabels()) { builder.addLabel(label); } return builder.build(); }
assertEquals(scan.getAttributeSize(), scanCopy.getAttributeSize()); assertEquals(scan.getAttributesMap(), scanCopy.getAttributesMap()); assertEquals(scan.getAuthorizations().getLabels(), scanCopy.getAuthorizations().getLabels()); assertEquals(scan.getBatch(), scanCopy.getBatch()); assertEquals(scan.getCacheBlocks(), scanCopy.getCacheBlocks());
@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations != null) { return authorizations.getLabels(); } return null; } }
@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations == null || authorizations.getLabels() == null || authorizations.getLabels().isEmpty()) { String userName = user.getShortName(); Set<String> auths = new HashSet<String>(); auths.addAll(this.labelsCache.getUserAuths(userName)); auths.addAll(this.labelsCache.getGroupAuths(user.getGroupNames())); return new ArrayList<String>(auths); } return authorizations.getLabels(); }
@Override public List<String> getLabels(User user, Authorizations authorizations) { if (authorizations != null) { if (labelToFilter == null) return authorizations.getLabels(); List<String> newAuths = new ArrayList<>(); for (String auth : authorizations.getLabels()) { if (!labelToFilter.equals(auth)) newAuths.add(auth); } return newAuths; } 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; }
/** * Create a protocol buffer Authorizations based on a client Authorizations. * * @param authorizations * @return a protocol buffer Authorizations */ public static ClientProtos.Authorizations toAuthorizations(Authorizations authorizations) { ClientProtos.Authorizations.Builder builder = ClientProtos.Authorizations.newBuilder(); for (String label : authorizations.getLabels()) { builder.addLabel(label); } return builder.build(); }
/** * Create a protocol buffer Authorizations based on a client Authorizations. * * @param authorizations * @return a protocol buffer Authorizations */ public static ClientProtos.Authorizations toAuthorizations(Authorizations authorizations) { ClientProtos.Authorizations.Builder builder = ClientProtos.Authorizations.newBuilder(); for (String label : authorizations.getLabels()) { builder.addLabel(label); } return builder.build(); }
assertEquals(scan.getAttributeSize(), scanCopy.getAttributeSize()); assertEquals(scan.getAttributesMap(), scanCopy.getAttributesMap()); assertEquals(scan.getAuthorizations().getLabels(), scanCopy.getAuthorizations().getLabels()); assertEquals(scan.getBatch(), scanCopy.getBatch()); assertEquals(scan.getCacheBlocks(), scanCopy.getCacheBlocks());