otherUserVertex = ((SecureGraphUserRepository) userRepository).findByIdUserVertex(userId);
} else {
otherUserVertex = getGraph().getVertex(userId, authorizations);
}
if (otherUserVertex == null) {
throw new LumifyResourceNotFoundException("Could not find user: " + userId, userId);
}
Vertex workspaceVertex = getVertexFromWorkspace(workspace, authorizations);
if (workspaceVertex == null) {
throw new LumifyResourceNotFoundException("Could not find workspace vertex: " + workspace.getWorkspaceId(), workspace.getWorkspaceId());
}
List<Edge> existingEdges = toList(workspaceVertex.getEdges(otherUserVertex, Direction.OUT, workspaceToUserRelationshipId, authorizations));
if (existingEdges.size() > 0) {
for (Edge existingEdge : existingEdges) {