protected Authorizations getAuthorizations(String workspaceId, String... otherAuthorizations) { if (isPublic(workspaceId) && (otherAuthorizations == null || otherAuthorizations.length == 0)) { return new InMemoryAuthorizations(VISIBILITY_STRING); } if (isPublic(workspaceId)) { return new InMemoryAuthorizations(ArrayUtils.add(otherAuthorizations, VISIBILITY_STRING)); } else if (otherAuthorizations == null || otherAuthorizations.length == 0) { return new InMemoryAuthorizations(VISIBILITY_STRING, workspaceId); } return new InMemoryAuthorizations(ArrayUtils.addAll(otherAuthorizations, VISIBILITY_STRING, workspaceId)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } InMemoryAuthorizations that = (InMemoryAuthorizations) o; return ArrayUtils.intersectsAll(getAuthorizations(), that.getAuthorizations()); }
@Override public Authorizations createAuthorizations(String... auths) { addValidAuthorizations(auths); return new InMemoryAuthorizations(auths); }
@Override public boolean equals(org.vertexium.Authorizations authorizations) { return ArrayUtils.intersectsAll(getAuthorizations(), authorizations.getAuthorizations()); }
@Override protected Authorizations createAuthorizations(String... auths) { return new InMemoryAuthorizations(auths); }
@Override public boolean canRead(Visibility visibility) { Preconditions.checkNotNull(visibility, "visibility is required"); // this is just a shortcut so that we don't need to construct evaluators and visibility objects to check for an empty string. if (visibility.getVisibilityString().length() == 0) { return true; } VisibilityEvaluator visibilityEvaluator = new VisibilityEvaluator(new Authorizations(this.getAuthorizations())); ColumnVisibility columnVisibility = new ColumnVisibility(visibility.getVisibilityString()); try { return visibilityEvaluator.evaluate(columnVisibility); } catch (VisibilityParseException e) { throw new VertexiumException("could not evaluate visibility " + visibility.getVisibilityString(), e); } }
@Inject public InMemoryOntologyRepository( Graph graph, Configuration configuration, LockRepository lockRepository, CacheService cacheService ) throws Exception { super(configuration, lockRepository, cacheService); this.graph = graph; clearCache(); conceptsCache.put(PUBLIC_ONTOLOGY_CACHE_KEY, new HashMap<>()); relationshipsCache.put(PUBLIC_ONTOLOGY_CACHE_KEY, new HashMap<>()); propertiesCache.put(PUBLIC_ONTOLOGY_CACHE_KEY, new HashMap<>()); loadOntologies(getConfiguration(), new InMemoryAuthorizations(VISIBILITY_STRING)); }
authorizations = new InMemoryAuthorizations(VISIBILITY_SOURCE); configuration.putAll(getAdditionalConfiguration()); GraphPropertyWorkerPrepareData workerPrepareData = new GraphPropertyWorkerPrepareData(
authorizations = new InMemoryAuthorizations(VISIBILITY_SOURCE); configuration.putAll(getAdditionalConfiguration()); GraphPropertyWorkerPrepareData workerPrepareData = new GraphPropertyWorkerPrepareData(