public static Filter create(final PrincipalKeys principalsKeys) {
    if (isSuperUser()) {
      return null;
    }

    if (principalsKeys.isEmpty()) {
      return createNoPrincipalsFilter();
    }

    final ValueFilter.Builder valueFilterBuilder =
        ValueFilter.create().fieldName(NodeIndexPath.PERMISSIONS_READ.toString());

    for (final PrincipalKey principalKey : principalsKeys) {
      valueFilterBuilder.addValue(ValueFactory.newString(principalKey.toString()));
    }

    return valueFilterBuilder.build();
  }
 private static Filter createNoPrincipalsFilter() {
   return ValueFilter.create()
       .fieldName(NodeIndexPath.PERMISSIONS_READ.toString())
       .addValue(ValueFactory.newString(PrincipalKey.ofAnonymous().toString()))
       .build();
 }