Package com.tmm.enterprise.microblog.security

Examples of com.tmm.enterprise.microblog.security.ApplicationUser


    if (account == null) {
      account = createNewAdminUser("admin", "", "admin");
    }
    GrantedAuthority[] auths = new GrantedAuthority[1];
    auths[0] = new GrantedAuthorityImpl("ROLE_ADMIN");
    ApplicationUser user = new ApplicationUser(new Long(account.getId()),
        account.getUserName(), account.getPassword(), true, true, true,
        true, auths);
    Authentication auth = new TestingAuthenticationToken(user, "ignored",
        auths);
    auth.setAuthenticated(true);
View Full Code Here


  public ApplicationContext getApplicationContext() {
    return applicationContext;
  }

  public Account getModifyingAccount() {
    ApplicationUser user = getApplicationUser();
    Account account = getAccountService().loadAccount(user.getAccountId());
    return account;
  }
View Full Code Here

    Authentication auth = SecurityContextHolder.getContext()
        .getAuthentication();
    if (auth == null) {
      return null;
    }
    ApplicationUser user = (ApplicationUser) auth.getPrincipal();
    return user;
  }
View Full Code Here

    Account account = getAccountService().loadAccountByUserName(BATCH_USER_NAME);

    GrantedAuthority[] auths = new GrantedAuthority[1];
    auths[0] = new GrantedAuthorityImpl("ROLE_USER");

    ApplicationUser user = new ApplicationUser(new Long(account.getId()), account.getUserName(), account.getPassword(), true, true, true, true,
        auths);

    Authentication auth = new TestingAuthenticationToken(user, "ignored", auths);

    auth.setAuthenticated(true);
View Full Code Here

  @Before
  public void createAccount() {
    Account account = accountService.createNewBatchUser("test", "", "");
    GrantedAuthority[] auths = new GrantedAuthority[1];
    auths[0] = new GrantedAuthorityImpl("ROLE_USER");
    ApplicationUser user = new ApplicationUser(new Long(account.getId()),
        account.getUserName(), account.getPassword(), true, true, true,
        true, auths);
    Authentication auth = new TestingAuthenticationToken(user, "ignored",
        auths);
    auth.setAuthenticated(true);
View Full Code Here

TOP

Related Classes of com.tmm.enterprise.microblog.security.ApplicationUser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.