Package aim.domain.security

Examples of aim.domain.security.User


        serie33.setPolicyType(policyType3);
        entityManager.persist(policyType3);


        final Account admin = new Account(new Employee(new Passport("АВ", "468454"), "Иванов", "Иван"));
        final User aimSecurityAdimn = new User("admin", "a4a88c0872bf652bb9ed803ece5fd6e82354838a9bf59ab4babb1dab322154e1");
        Set<UserRoles> userRoles = new TreeSet<UserRoles>();
        userRoles.add(UserRoles.ROLE_USER);
        userRoles.add(UserRoles.ROLE_ADMIN);
        admin.setAssociatedRoles(userRoles);
        admin.setAccount(aimSecurityAdimn);
View Full Code Here


    /**
     * {@inheritDoc }
     */
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
        User account = userService.getAccountByNickname(username);
        Account user = userService.getEmployeeByNickName(username);
        List<GrantedAuthority> grantedAuthority = new ArrayList<GrantedAuthority>();
        for (UserRoles role : user.getAssociatedRoles()) {
            grantedAuthority.add(new GrantedAuthorityImpl(role.toString()));
        }

        account.setGrantedAuthoritys((GrantedAuthority[]) grantedAuthority.toArray(new GrantedAuthority[grantedAuthority.size()]));
        return account;
    }
View Full Code Here

TOP

Related Classes of aim.domain.security.User

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.