User user = getUser();
if (user.checkAuthorisation(UserModule.AUTH_USER_EDIT)) {
UserGroup selectedUserGroup = null;
if (selected == null || selected.equals("")) {
log.debug("create user Group");
selectedUserGroup = new UserGroup();
session.removeAttribute("selectedUserGroup");
} else {
selectedUserGroup = userGroupDao.getUserGroup(selected);
session.setAttribute("selectedUserGroup", selectedUserGroup.getId());
}
view.addWidget(new SimpleWidget(ZeroView.DIV_CONTENT, "user_userGroupEdit"));
JSONObject jUG = new JSONObject();
jUG.element("groupKey", selectedUserGroup.getGroupKey());
jUG.element("description", selectedUserGroup.getDescription());
view.getJson().element("userGroup", jUG);
}
return new ModelAndView(view, null);
}