DocumentModel doc = socialWorkspace.getDocument();
doc.setPropertyValue(SOCIAL_WORKSPACE_IS_PUBLIC_PROPERTY, false);
doc.putContextData(ScopeType.REQUEST,
SocialWorkspaceListener.DO_NOT_PROCESS, true);
CoreSession session = doc.getCoreSession();
makePublicSectionUnreadable(session, socialWorkspace);
makePublicDashboardUnreadable(session, socialWorkspace);
doc = session.saveDocument(doc);
session.save();
socialWorkspace.setDocument(doc);
} catch (ClientException e) {
throw new ClientRuntimeException(e);
}
}