Package org.picketlink.idm.model

Examples of org.picketlink.idm.model.Role


     */
    @Override
    public GrantConfiguration roles(String[] roles) {
        list = new ArrayList<Role>();
        for (String role : roles) {
            Role newRole = identityManager.getRole(role);
            if (newRole == null) {
                newRole = new SimpleRole(role);
                identityManager.add(newRole);
            }
            list.add(newRole);
View Full Code Here


    @Override
    public GrantConfiguration revoke(String... roles) {
        list = new ArrayList<Role>();
        if (identity.isLoggedIn()) {
            for (String role : roles) {
                Role retrievedRole = identityManager.getRole(role);
                if (retrievedRole != null && identityManager.hasRole(identity.getAgent(), retrievedRole)) {
                    list.add(retrievedRole);
                }
            }
        }
View Full Code Here

    @Override
    public boolean hasRoles(Set<String> roles) {

        if (identity.isLoggedIn()) {
            for (String role : roles) {
                Role retrievedRole = identityManager.getRole(role);
                if (retrievedRole != null && identityManager.hasRole(identity.getAgent(), retrievedRole)) {
                    return true;
                }
            }
        }
View Full Code Here

        return query.getResultList().get(0);
    }

    @Override
    public List<User> findAllByRole(String name) {
        Role role = identityManager.getRole(name);
        IdentityQuery<User> query = identityManager.createIdentityQuery(User.class);
        query.setParameter(User.HAS_ROLE, role);
        return query.getResultList();
    }
View Full Code Here

        identityManager.remove(identityManager.getUser(aeroGearUser.getUsername()));
    }

    @Override
    public List<AeroGearUser> findAllByRole(String roleName) {
        Role role = identityManager.getRole(roleName);
        List aerogearUsers = new ArrayList();
        IdentityQuery<User> query = identityManager.createIdentityQuery(User.class);
        query.setParameter(User.HAS_ROLE, role);
        List<User> result = query.getResultList();
        for (User user : result) {
View Full Code Here

     */
    @Override
    public boolean hasRoles(Set<String> roles) {
        if (identity.isLoggedIn()) {
            for (String role : roles) {
                Role retrievedRole = identityManager.getRole(role);
                if (retrievedRole != null && identityManager.hasRole(identity.getAgent(), retrievedRole)) {
                    return true;
                }
            }
        }
View Full Code Here

        return query.getResultList().get(0);
    }

    @Override
    public List<User> findAllByRole(String name) {
        Role role = identityManager.getRole(name);
        IdentityQuery<User> query = identityManager.createIdentityQuery(User.class);
        query.setParameter(User.HAS_ROLE, role);
        return query.getResultList();
    }
View Full Code Here

         * See http://lists.jboss.org/pipermail/security-dev/2013-January/000650.html for more information
         */
        this.identityManager.add(user);
        this.identityManager.updateCredential(user, new Password("123"));

        Role roleDeveloper = new SimpleRole("simple");
        Role roleAdmin = new SimpleRole("admin");

        this.identityManager.add(roleDeveloper);
        this.identityManager.add(roleAdmin);

        identityManager.grantRole(user, roleDeveloper);
View Full Code Here

     * @return builder implementation
     */
    public GrantConfiguration roles(String[] roles) {
        list = new ArrayList<Role>();
        for (String role : roles) {
            Role newRole = identityManager.getRole(role);
            if (newRole == null) {
                newRole = new SimpleRole(role);
                identityManager.add(newRole);
            }
            list.add(newRole);
View Full Code Here

        identityManager.remove(identityManager.getUser(aeroGearUser.getUsername()));
    }

    @Override
    public List<AeroGearUser> findAllByRole(String roleName) {
        Role role = identityManager.getRole(roleName);
        List aerogearUsers = new ArrayList();
        IdentityQuery<User> query = identityManager.createIdentityQuery(User.class);
        query.setParameter(User.HAS_ROLE, role);
        List<User> result = query.getResultList();
        for (User user : result) {
View Full Code Here

TOP

Related Classes of org.picketlink.idm.model.Role

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.