Package com.sparc.knappsack.components.entities

Examples of com.sparc.knappsack.components.entities.UserDomain


        return userDomainDao.getUserDomain(user, domainId, userRole);
    }

    @Override
    public UserDomain get(User user, Long domainId) {
        UserDomain userDomain = null;
        if (user != null && domainId != null && domainId > 0) {
            userDomain = userDomainDao.getUserDomain(user, domainId);
        }
        return userDomain;
    }
View Full Code Here


    @Override
    public void removeUserDomainFromDomain(Long domainId, Long userId) {
        if (domainId != null && domainId > 0 && userId != null && userId > 0) {
            User user = userService.get(userId);
            if (user != null && user.getUserDomains() != null) {
                UserDomain userDomain = userDomainDao.getUserDomain(user, domainId);

                if (userDomain != null) {
                    if (user.getUserDomains().contains(userDomain)) {
                        user.getUserDomains().remove(userDomain);
                    }
View Full Code Here

    }

    @Override
    public void updateUserDomainRole(Long userId, Long domainId, UserRole userRole) {
        User user = userService.get(userId);
        UserDomain userDomain = get(user, domainId);

        if (userDomain != null) {
            userDomain.setRole(roleService.getRoleByAuthority(userRole.toString()));

            update(userDomain);
        }
    }
View Full Code Here

    @Override
    public boolean acceptRequest(DomainUserRequest domainUserRequest, UserRole userRole) {
        boolean success = false;
        if (domainUserRequest != null && userRole != null) {
            UserDomain userDomain = userService.addUserToDomain(domainUserRequest.getUser(), domainUserRequest.getDomain(), userRole);

            if (userDomain != null) {
                domainUserRequest.setStatus(Status.ACCEPTED);
//                update(domainUserRequest);
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.components.entities.UserDomain

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.