197198199200201202203204205206207
assertTrue(user.hasRole("editor")); assertFalse(user.hasRole("admin")); // add role user.grantRole("admin"); mgr.saveUser(user); TestUtils.endSession(true); // check that role was added user = null; user = mgr.getUserByUserName(testUser.getUserName());
218219220221222223224225226227228
} if (msgs.isEmpty()) { try { // Persist changes to user mgr.saveUser(user); RollerFactory.getRoller().flush(); msgs.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("userSettings.saved")); saveMessages(request, msgs);
216217218219220221222223224225226
ud.setEmailAddress(entry.getEmailAddress()); } try { UserManager mgr = getRoller().getUserManager(); mgr.saveUser(ud); getRoller().flush(); CacheManager.invalidate(ud); } catch (RollerException re) { throw new InternalException("ERROR: could not update user data", re); }
152153154155156157158159160161162
} } // save the updated profile UserManager mgr = RollerFactory.getRoller().getUserManager(); mgr.saveUser(data); RollerFactory.getRoller().flush(); request.setAttribute("model", new BasePageModel( "yourProfile.title", request, response, mapping));