use of org.vertexium.Visibility in project vertexium by visallo.
the class MetadataTablePropertyNameVisibilitiesStore method getHashesWithAuthorization.
public Collection<String> getHashesWithAuthorization(Graph graph, String authorization, Authorizations authorizations) {
List<String> hashes = new ArrayList<>();
for (GraphMetadataEntry metadata : graph.getMetadataWithPrefix(HASH_TO_VISIBILITY)) {
Visibility visibility = getVisibility((String) metadata.getValue());
if (authorizations.canRead(visibility) && visibility.hasAuthorization(authorization)) {
String hash = metadata.getKey().substring(HASH_TO_VISIBILITY.length());
hashes.add(hash);
}
}
return hashes;
}
Aggregations