if( agreementEnabled
&& false == agreementContents.contains(userAgreement) ){
throw new Exception("Provided agreement does not match the one found in the atlas.");
}
CouchAuthenticationContext context = userRepository.getRolesFromAuthentication(cookies);
JSONObject userDoc = userRepository.getUserFromName(context.getName());
// Update user document with agreement
JSONObject nunaliit_accepted_user_agreements = userDoc.optJSONObject("nunaliit_accepted_user_agreements");
if( null == nunaliit_accepted_user_agreements ){
nunaliit_accepted_user_agreements = new JSONObject();