Exemple #1
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;
 }
Exemple #2
0
  @Secure
  @Override
  public User getCurrentUser() {
    if (!authenticationService.isLoggedIn()) {
      return null;
    }

    String username = authenticationService.getUser().getLoginName();
    User u = userDAO.get(username);
    return u;
  }
Exemple #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;
 }
Exemple #4
0
 @Secure(value = Role.USER, owner = "#{arg0.username}")
 @Override
 public void update(User user) throws ValidationException {
   userDAO.update(user);
 }
Exemple #5
0
 @Override
 public void create(User user) throws ValidationException {
   userDAO.createRegularUser(user);
 }