Package com.evasion.entity.security

Examples of com.evasion.entity.security.Authority


        updateUser(u.getUser());
        return em.merge(u);
    }

    public Authority findOrCreateAdminAuthority() {
        Authority auth = authDAO.findByAuthorityName("ROLE_ADMIN");
        if (auth == null) {
            auth = new Authority("ROLE_ADMIN");
            authDAO.persist(auth);
        }
        return auth;
    }
View Full Code Here


        }
        return acc;
    }

    public void checkOrUpdateAdminAuth() throws EvasionException {
        Authority auth = findOrCreateAdminAuthority();
        User admin = findOrCreateAdminAccount().getUser();
        if (!admin.getAuthorities().contains(auth)) {
            admin.addAuthority(auth);
            updateUser(admin);
        }
View Full Code Here

     * Fourni le role par défaut et le créé si besoin.
     *
     * @return role par défaut de tout les utilisateurs.
     */
    private Authority getDefaultAuthority() {
        Authority result = authDAO.findByAuthorityName(Constante.DEFAULT_AUTH_NAME);

        if (result == null) {
            result = authDAO.merge(new Authority(Constante.DEFAULT_AUTH_NAME));
        }
        return result;
    }
View Full Code Here

        updateUser(u.getUser());
        return em.merge(u);
    }

    public Authority findOrCreateAdminAuthority() {
        Authority auth = authDAO.findByAuthorityName("ROLE_ADMIN");
        if (auth == null) {
            auth = new Authority("ROLE_ADMIN");
            authDAO.persist(auth);
        }
        return auth;
    }
View Full Code Here

        }
        return acc;
    }

    public void checkOrUpdateAdminAuth() throws EvasionException {
        Authority auth = findOrCreateAdminAuthority();
        User admin = findOrCreateAdminAccount().getUser();
        if (!admin.getAuthorities().contains(auth)) {
            admin.addAuthority(auth);
            updateUser(admin);
        }
View Full Code Here

     * Fourni le role par défaut et le créé si besoin.
     *
     * @return role par défaut de tout les utilisateurs.
     */
    private Authority getDefaultAuthority() {
        Authority result = authDAO.findByAuthorityName(Constante.DEFAULT_AUTH_NAME);

        if (result == null) {
            result = authDAO.merge(new Authority(Constante.DEFAULT_AUTH_NAME));
        }
        return result;
    }
View Full Code Here

        boolean result;
        result = (user.getAuthorities() != null && !user.getAuthorities().isEmpty())
                || (user.getGroups() != null && !user.getGroups().isEmpty());
        if (!result) {
            HashSet<Authority> auth = (new HashSet<Authority>());
            auth.add(new Authority("ROLE_USER"));
            user.addAllAuthority(auth);
        }
    }
View Full Code Here

        updateUser(u.getUser());
        return em.merge(u);
    }

    public Authority findOrCreateAdminAuthority() {
        Authority auth = authDAO.findByAuthorityName("ROLE_ADMIN");
        if (auth == null) {
            auth = new Authority("ROLE_ADMIN");
            authDAO.persist(auth);
        }
        return auth;
    }
View Full Code Here

        }
        return acc;
    }

    public void checkOrUpdateAdminAuth() throws EvasionException {
        Authority auth = findOrCreateAdminAuthority();
        User admin = findOrCreateAdminAccount().getUser();
        if (!admin.getAuthorities().contains(auth)) {
            admin.addAuthority(auth);
            updateUser(admin);
        }
View Full Code Here

     * Fourni le role par défaut et le créé si besoin.
     *
     * @return role par défaut de tout les utilisateurs.
     */
    private Authority getDefaultAuthority() {
        Authority result = authDAO.findByAuthorityName(Constante.DEFAULT_AUTH_NAME);

        if (result == null) {
            result = authDAO.merge(new Authority(Constante.DEFAULT_AUTH_NAME));
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of com.evasion.entity.security.Authority

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.