use of org.vertexium.GraphMetadataEntry in project vertexium by visallo.
the class MetadataTablePropertyNameVisibilitiesStore method getHashes.
public Collection<String> getHashes(Graph graph, String propertyName, Authorizations authorizations) {
List<String> results = new ArrayList<>();
String prefix = getPropertyNameVisibilityToHashPrefix(propertyName);
for (GraphMetadataEntry metadata : graph.getMetadataWithPrefix(prefix)) {
String visibilityString = metadata.getKey().substring(prefix.length());
Visibility visibility = getVisibility(visibilityString);
if (authorizations.canRead(visibility)) {
String hash = (String) metadata.getValue();
results.add(hash);
}
}
return results;
}
use of org.vertexium.GraphMetadataEntry 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