if (!password.trim().equals(realpassword)) {
throw new UnauthorizedException("ERROR: User is not authorized: " + userName);
}
List<String> adminActions = new ArrayList<String>();
adminActions.add("admin");
GlobalPermission adminPerm = new GlobalPermission(ud, adminActions);
if (!WebloggerFactory.getWeblogger().getUserManager().checkPermission(adminPerm, ud)) {
throw new UnauthorizedException("ERROR: User must have the admin role to use the RAP endpoint: " + userName);
}
if (!ud.getEnabled().booleanValue()) {
throw new UnauthorizedException("ERROR: User is disabled: " + userName);