try {
// once created a role name cannot be modified, so the text field
// will be disabled in the form.
boolean update = StringUtils.isBlank(request.getParameter("roleName"));
String roleName = (update) ? updateRole : request.getParameter("roleName");
role = new RoleImpl(roleName);
role.setDescription(request.getParameter("roleDescription"));
WikiUtil.validateRole(role);
WikiBase.getDataHandler().writeRole(role, update);
if (!StringUtils.isBlank(updateRole) && updateRole.equals(role.getAuthority())) {
next.addObject("message", new WikiMessage("roles.message.roleupdated", role.getAuthority()));