Package org.openengsb.core.services.internal.security.model

Examples of org.openengsb.core.services.internal.security.model.UserData


        return getPermissionsFromSetData(user.getPermissionSet());
    }

    @Override
    public Collection<Permission> getAllPermissionsForUser(String username) throws UserNotFoundException {
        UserData user = doFindUser(username);
        return getAllPermissionsFromSetData(user.getPermissionSet());
    }
View Full Code Here


        return CollectionUtilsExtended.filterCollectionByClass(getAllPermissionsForUser(username), type);
    }

    @Override
    public void addPermissionToUser(String username, Permission... permission) throws UserNotFoundException {
        UserData user = doFindUser(username);
        addPermissionsToSet(user.getPermissionSet(), permission);
    }
View Full Code Here

        return permissionData;
    }

    @Override
    public void removePermissionFromUser(String username, final Permission... permission) throws UserNotFoundException {
        UserData user = doFindUser(username);
        doRemovePermissionsFromSet(user.getPermissionSet(), permission);
    }
View Full Code Here

        }
    }

    @Override
    public Collection<String> getPermissionSetsFromUser(String username) throws UserNotFoundException {
        UserData user = doFindUser(username);
        Collection<PermissionSetData> permissionSets = user.getPermissionSet().getPermissionSets();
        return Collections2.transform(permissionSets, new Function<PermissionSetData, String>() {
            @Override
            public String apply(PermissionSetData input) {
                return input.getName();
            }
View Full Code Here

        });
    }

    @Override
    public void addPermissionSetToUser(String username, String... permissionSet) throws UserNotFoundException {
        UserData user = doFindUser(username);
        doAddPermissionSetToSet(user.getPermissionSet(), permissionSet);
    }
View Full Code Here

        doAddPermissionSetToSet(user.getPermissionSet(), permissionSet);
    }

    @Override
    public void removePermissionSetFromUser(String username, String... permissionSet) throws UserNotFoundException {
        UserData user = doFindUser(username);
        doRemovePermissionSetFromSet(user.getPermissionSet(), permissionSet);
    }
View Full Code Here

            CriteriaQuery<UserData> query = cb.createQuery(UserData.class);
            Root<UserData> from = query.from(UserData.class);
            query.where(cb.equal(from.get("username"), username));
            query.select(from);
            try {
                UserData found = entityManager.createQuery(query).getSingleResult();
                return found;
            } catch (Exception ex) {
                throw new UserNotFoundException("User with name " + username + " not found");
            }
        }
View Full Code Here

TOP

Related Classes of org.openengsb.core.services.internal.security.model.UserData

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.