Пример #1
0
  @Handle
  public ClientApiSuccess handle(
      @Required(name = "graphVertexId") String graphVertexId,
      @Required(name = "propertyKey") String propertyKey,
      @Required(name = "propertyName") String propertyName,
      @ActiveWorkspaceId String workspaceId,
      User user,
      Authorizations authorizations)
      throws Exception {
    OntologyProperty ontologyProperty = ontologyRepository.getRequiredPropertyByIRI(propertyName);

    Vertex vertex = graph.getVertex(graphVertexId, authorizations);

    if (!aclProvider.canDeleteProperty(vertex, propertyKey, propertyName, user)) {
      throw new VisalloAccessDeniedException(
          propertyName + " is not deleteable", user, graphVertexId);
    }

    boolean isComment = VisalloProperties.COMMENT.getPropertyName().equals(propertyName);
    if (isComment && autoPublishComments) {
      workspaceId = null;
    }

    workspaceHelper.deleteProperties(
        vertex, propertyKey, propertyName, ontologyProperty, workspaceId, authorizations, user);

    return VisalloResponse.SUCCESS;
  }
 @Traced
 public Vertex findByIdUserVertex(String userId) {
   Vertex userVertex = userVertexCache.getIfPresent(userId);
   if (userVertex != null) {
     return userVertex;
   }
   userVertex = graph.getVertex(userId, authorizations);
   if (userVertex != null) {
     userVertexCache.put(userId, userVertex);
   }
   return userVertex;
 }