Search in sources :

Example 11 with Visibility

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;
}
Also used : GraphMetadataEntry(org.vertexium.GraphMetadataEntry) Visibility(org.vertexium.Visibility)

Aggregations

Visibility (org.vertexium.Visibility)11 Test (org.junit.Test)6 GraphMetadataEntry (org.vertexium.GraphMetadataEntry)2 MutablePropertyImpl (org.vertexium.property.MutablePropertyImpl)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Matcher (java.util.regex.Matcher)1 Property (org.vertexium.Property)1