Package org.picketlink.idm.model.sample

Examples of org.picketlink.idm.model.sample.Role


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


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

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

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

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

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

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

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

     * @param name Role name
     * @return Users by roles
     */
    @Override
    public List<User> findAllByRole(String name) {
        Role role = SampleModel.getRole(identityManager, name);
        IdentityQuery<User> query = identityManager.createIdentityQuery(User.class);
        query.setParameter(GroupRole.ROLE, role);
        return query.getResultList();
    }
View Full Code Here

TOP

Related Classes of org.picketlink.idm.model.sample.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.