Package org.sete.vo.common

Examples of org.sete.vo.common.UserRolePrivilegeVo



    private List<UserRolePrivilegeVo> createUserRolePrivileges() {
        List<UserRolePrivilegeVo> urpVoList = new ArrayList<UserRolePrivilegeVo>();
        List<UserPrivilegeVo> upVoList = null;
        UserRolePrivilegeVo urpVo = null;

        // One --
        upVoList = new ArrayList<UserPrivilegeVo>();
        upVoList.add(createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_JUDGE_RESULTS_KEY,
                                           PrivilegeActionType.Key.READ_KEY));

        upVoList.add(createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_JUDGE_SCHEDULE_KEY,
                                           PrivilegeActionType.Key.READ_WRITE_KEY));

        urpVo = new UserRolePrivilegeVo();
        urpVo.setRoleType(TypeUtil.forKey(UserRoleType.class, UserRoleType.Key.JUDGE_KEY.getKey()));
        urpVo.setUserPrivileges(upVoList);

        urpVoList.add(urpVo);


        // Two --
        upVoList = new ArrayList<UserPrivilegeVo>();
        upVoList.add(createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_REFERENCE_DATA_KEY,
                                           PrivilegeActionType.Key.READ_KEY));

        upVoList.add(createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_ROLES_KEY,
                                           PrivilegeActionType.Key.READ_WRITE_KEY));

        urpVo = new UserRolePrivilegeVo();
        urpVo.setRoleType(TypeUtil.forKey(UserRoleType.class, UserRoleType.Key.ADMIN_KEY.getKey()));
        urpVo.setUserPrivileges(upVoList);

        urpVoList.add(urpVo);


        // Three --
        upVoList = new ArrayList<UserPrivilegeVo>();
        upVoList.add(createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_SPONSORED_PROJECT_KEY,
                                           PrivilegeActionType.Key.READ_KEY));

        upVoList.add(createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_USERS_KEY,
                                           PrivilegeActionType.Key.READ_WRITE_KEY));

        urpVo = new UserRolePrivilegeVo();
        urpVo.setRoleType(TypeUtil.forKey(UserRoleType.class, UserRoleType.Key.SPONSOR_KEY.getKey()));
        urpVo.setUserPrivileges(upVoList);

        urpVoList.add(urpVo);

        return urpVoList;
    }
View Full Code Here


        vo.setLoginName(su.getLoginName());
        vo.setMiddleName(su.getMiddleName());
        vo.setUserId(su.getId());

        List<UserRolePrivilegeVo> pVos = new ArrayList<UserRolePrivilegeVo>();
        UserRolePrivilegeVo pVo = null;
        List<UserPrivilegeVo> upVos = null;
        UserPrivilegeVo upVo = null;
        for(UserRolePrivilege p : su.getUserRolePrivileges()) {
            pVo = new UserRolePrivilegeVo();
            pVo.setRoleType(p.getUserRoleType());

            upVos = new ArrayList<UserPrivilegeVo>();
            for(UserPrivilege up : p.getUserPrivileges()) {
                upVo = new UserPrivilegeVo();
                upVo.setPrivilegeType(up.getUserPrivilegeType());
                upVo.setActionType(up.getPrivilegeActionType());
                upVos.add(upVo);
            }

            pVo.setUserPrivileges(upVos);
            pVos.add(pVo);
        }

        vo.setUserRolePrivileges(pVos);
        return vo;
View Full Code Here

TOP

Related Classes of org.sete.vo.common.UserRolePrivilegeVo

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.