248249250251252253254255256
User user = userDAO.getUserForId(id); userDAO.delete(user); userCache.removeUserFromCache(user.getUsername()); } else { throw new PermissionDeniedException( "You don't have rights to do that."); } }
485486487488489490491492493
if (getCurrentUser().isSupervisor()) { User user = userDAO.getUserForId(id); user.setEnabled(!user.isEnabled()); save(user); } else { throw new PermissionDeniedException( "You don't have rights to do that."); } }
498499500501502503504505506
System.out.println("ID " + id); User user = userDAO.getUserForId(id); user.setSupervisor(!user.isSupervisor()); save(user); } else { throw new PermissionDeniedException( "You don't have rights to do that."); } }