}
public ClientApiWorkspaceDiff diff(Workspace workspace, List<WorkspaceEntity> workspaceEntities, List<Edge> workspaceEdges, User user) {
Authorizations authorizations = userRepository.getAuthorizations(user, WorkspaceRepository.VISIBILITY_STRING, workspace.getWorkspaceId());
ClientApiWorkspaceDiff result = new ClientApiWorkspaceDiff();
for (WorkspaceEntity workspaceEntity : workspaceEntities) {
List<ClientApiWorkspaceDiff.Item> entityDiffs = diffWorkspaceEntity(workspace, workspaceEntity, authorizations);
if (entityDiffs != null) {
result.addAll(entityDiffs);
}
}
for (Edge workspaceEdge : workspaceEdges) {
List<ClientApiWorkspaceDiff.Item> entityDiffs = diffEdge(workspace, workspaceEdge);
if (entityDiffs != null) {
result.addAll(entityDiffs);
}
}
return result;
}