150151152153154155156157
return comment; } private void verifyLoggedIn(UserSession userSession) { if (!userSession.isLoggedIn()) { throw new UnauthorizedException("User is not logged in"); } }
124125126127128129130131132
return this; } public UserSession checkLoggedIn() { if (login == null) { throw new UnauthorizedException("Authentication is required"); } return this; }
215216217218219220221222223
} public String getLoggedLogin(UserSession userSession) { String user = userSession.login(); if (!userSession.isLoggedIn()) { throw new UnauthorizedException("User is not logged in"); } return user; }