@Override public void deleteAll(Session s) throws WPISuiteException { User theUser = s.getUser(); logger.log(Level.INFO, "ProjectManager invoking DeleteAll..."); if (theUser.getRole().equals(Role.ADMIN)) { data.deleteAll(new Project("", "")); } else { logger.log( Level.WARNING, "ProjectManager DeleteAll attempted by user with insufficient permission"); throw new UnauthorizedException( "You do not have the required permissions to perform this action."); } }
/* * Commitments can be deleted * * @see edu.wpi.cs.wpisuitetng.modules.EntityManager#deleteAll(edu.wpi.cs.wpisuitetng.Session) */ @Override public void deleteAll(Session s) throws WPISuiteException { db.deleteAll(new Commitment()); }