@Secure @Override public OAuthConsumerEntity getClientAppEntity() throws ValidationException { OAuthConsumerEntity e = userDAO.getClientApp(authenticationService.getUser().getLoginName()); // Because of lazy loading and to save traffic e.getUser().setGraphs(null); e.setAccessTokens(null); e.setRequestTokens(null); return e; }
@Secure @Override public User getCurrentUser() { if (!authenticationService.isLoggedIn()) { return null; } String username = authenticationService.getUser().getLoginName(); User u = userDAO.get(username); return u; }
@Secure(owner = "#{arg0.user.username}") @Override public OAuthConsumerEntity createOrUpdate(OAuthConsumerEntity clientAppEntity) throws ValidationException { OAuthConsumerEntity e = userDAO.createOrUpdate(clientAppEntity, authenticationService.getUser().getLoginName()); // Because of lazy loading and to save traffic e.getUser().setGraphs(null); e.getUser().setAccessTokens(null); e.setAccessTokens(null); e.setRequestTokens(null); return e; }
@Secure(value = Role.USER, owner = "#{arg0.username}") @Override public void update(User user) throws ValidationException { userDAO.update(user); }
@Override public void create(User user) throws ValidationException { userDAO.createRegularUser(user); }