final String visibilitySource = getRequiredParameter(request, "visibilitySource");
final String resolvedVertexId = getOptionalParameter(request, "resolvedVertexId");
final String justificationText = getOptionalParameter(request, "justificationText");
final String sourceInfo = getOptionalParameter(request, "sourceInfo");
User user = getUser(request);
String workspaceId = getActiveWorkspaceId(request);
Workspace workspace = workspaceRepository.findById(workspaceId, user);
Authorizations authorizations = getAuthorizations(request, user);
VisibilityJson visibilityJson = GraphUtil.updateVisibilitySourceAndAddWorkspaceId(null, visibilitySource, workspaceId);
LumifyVisibility visibility = this.visibilityTranslator.toVisibility(visibilityJson);
if (!graph.isVisibilityValid(visibility.getVisibility(), authorizations)) {
LOGGER.warn("%s is not a valid visibility for %s user", visibilitySource, user.getDisplayName());
respondWithBadRequest(response, "visibilitySource", getString(request, "visibility.invalid"));
chain.next(request, response);
return;
}