Search in sources :

Example 1 with Authorisations

use of uk.gov.gchq.gaffer.commonutil.elementvisibilityutil.Authorisations in project Gaffer by gchq.

the class GetElementsUtil method applyVisibilityFilter.

public static Stream<Element> applyVisibilityFilter(final Stream<Element> elements, final Schema schema, final User user) {
    final Set<String> dataAuths = user.getDataAuths();
    final Authorisations authorisations = new Authorisations(dataAuths.toArray(new String[dataAuths.size()]));
    return elements.filter(e -> isVisible(e, schema.getVisibilityProperty(), authorisations));
}
Also used : Authorisations(uk.gov.gchq.gaffer.commonutil.elementvisibilityutil.Authorisations)

Aggregations

Authorisations (uk.gov.gchq.gaffer.commonutil.elementvisibilityutil.Authorisations)1