Пример #1
0
  @Secure
  @Override
  public User getCurrentUser() {
    if (!authenticationService.isLoggedIn()) {
      return null;
    }

    String username = authenticationService.getUser().getLoginName();
    User u = userDAO.get(username);
    return u;
  }
Пример #2
0
 @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;
 }
Пример #3
0
 @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;
 }