Package org.sete.vo.common

Examples of org.sete.vo.common.UserPrivilegeVo


        menuPrivVo.setCreateProjectIdeaVisible(userVo.hasPrivilege(userPrivVo));
    }

    private void setProjectWorkspaceMenuPrivileges(SideMenuVo menuPrivVo, AuthenticatedUserVo userVo) {
        UserPrivilegeVo userPrivVo = new UserPrivilegeVo();

        // Create Project
        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_MY_PROJECT_KEY.getKey()));
        userPrivVo.setActionType(getReadWriteAction());

        boolean hasAccess = userVo.hasPrivilege(userPrivVo);
        menuPrivVo.setViewCreateProjectVisible(hasAccess);
        menuPrivVo.setViewMyProjectVisible(hasAccess);
        menuPrivVo.setUploadDocumentsVisible(hasAccess);
View Full Code Here


        menuPrivVo.setViewMyProjectVisible(hasAccess);
        menuPrivVo.setUploadDocumentsVisible(hasAccess);
    }

    private void setJudgeMenuPrivileges(SideMenuVo menuPrivVo, AuthenticatedUserVo userVo) {
        UserPrivilegeVo userPrivVo = new UserPrivilegeVo();

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_JUDGE_SCHEDULE_KEY.getKey()));

        userPrivVo.setActionType(getReadWriteAction());
        boolean judgePrivileges = userVo.hasPrivilege(userPrivVo);

        menuPrivVo.setSubmitJudgingResultsVisible(judgePrivileges);
        menuPrivVo.setViewJudgeScheduleVisible(judgePrivileges);
        menuPrivVo.setViewJudgingResultsReportVisible(judgePrivileges);
View Full Code Here

    public void testUserHasPrivilege() throws Exception {
        AuthenticatedUserVo user = new AuthenticatedUserVo();
        user.setUserRolePrivileges(createUserRolePrivileges());

        UserPrivilegeVo allowedPriv = createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_JUDGE_SCHEDULE_KEY,
                                                            PrivilegeActionType.Key.READ_WRITE_KEY);

        assertTrue("User should have had Manage Judge Schedule Read/Write access.",
                   user.hasPrivilege(allowedPriv));
View Full Code Here

        menuPrivVo.setViewJudgeScheduleVisible(judgePrivileges);
        menuPrivVo.setViewJudgingResultsReportVisible(judgePrivileges);
    }

    private void setSponsorMenuPrivileges(SideMenuVo menuPrivVo, AuthenticatedUserVo userVo) {
        UserPrivilegeVo userPrivVo = new UserPrivilegeVo();

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.SPONSOR_PROJECT_KEY.getKey()));

        userPrivVo.setActionType(getReadWriteAction());
        menuPrivVo.setSponsorProjectsVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo = new UserPrivilegeVo();
        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_SPONSORED_PROJECT_KEY.getKey()));
        userPrivVo.setActionType(getReadAction());
        menuPrivVo.setViewSponsoredProjectsVisible(userVo.hasPrivilege(userPrivVo));
    }
View Full Code Here

    public void testUserHasInvalidPrivilege() throws Exception {
        AuthenticatedUserVo user = new AuthenticatedUserVo();
        user.setUserRolePrivileges(createUserRolePrivileges());

        UserPrivilegeVo allowedPriv = createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_MY_PROFILE_KEY,
                                                            PrivilegeActionType.Key.READ_KEY);

        assertFalse("User should not ave had Manage My Profile Read access.",
                   user.hasPrivilege(allowedPriv));
View Full Code Here

        return urpVoList;
    }

    private UserPrivilegeVo createUserPrivilegeVo(UserPrivilegeType.Key privilegeKey,
                                                  PrivilegeActionType.Key actionKey) {
        UserPrivilegeVo upVo = new UserPrivilegeVo();
        upVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
                                           actionKey.getKey()));
        upVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                              privilegeKey.getKey()));

        return upVo;
    }
View Full Code Here

        userPrivVo.setActionType(getReadAction());
        menuPrivVo.setViewSponsoredProjectsVisible(userVo.hasPrivilege(userPrivVo));
    }

    private void setSeteAdministratorMenuPrivileges(SideMenuVo menuPrivVo, AuthenticatedUserVo userVo) {
        UserPrivilegeVo userPrivVo = new UserPrivilegeVo();
        List<UserPrivilegeVo> privs = new ArrayList<UserPrivilegeVo>();

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_USERS_KEY.getKey()));
        userPrivVo.setActionType(getReadWriteAction());
        privs.add(userPrivVo);

        userPrivVo = new UserPrivilegeVo();
        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_ROLES_KEY.getKey()));
        userPrivVo.setActionType(getReadWriteAction());
        privs.add(userPrivVo);

        userPrivVo = new UserPrivilegeVo();
        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.VIEW_ALL_PROJECTS_KEY.getKey()));
        userPrivVo.setActionType(getReadWriteAction());
        privs.add(userPrivVo);

        userPrivVo = new UserPrivilegeVo();
        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_PROJECT_FILES_KEY.getKey()));
        userPrivVo.setActionType(getReadWriteAction());
        privs.add(userPrivVo);

        menuPrivVo.setUsingJediForce(userVo.hasPrivilege(privs));
    }
View Full Code Here

        menuPrivVo.setUsingJediForce(userVo.hasPrivilege(privs));
    }

    private void setUserAccountMenuPrivileges(SideMenuVo menuPrivVo, AuthenticatedUserVo userVo) {
        UserPrivilegeVo userPrivVo = new UserPrivilegeVo();

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_MY_PROFILE_KEY.getKey()));

        userPrivVo.setActionType(getReadWriteAction());
        menuPrivVo.setCreateUserProfileVisible(userVo.hasPrivilege(userPrivVo));
    }
View Full Code Here

        userPrivVo.setActionType(getReadWriteAction());
        menuPrivVo.setCreateUserProfileVisible(userVo.hasPrivilege(userPrivVo));
    }

    private void setProjectCategoryMenuPrivileges(SideMenuVo menuPrivVo, AuthenticatedUserVo userVo) {
        UserPrivilegeVo userPrivVo = new UserPrivilegeVo();

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_REFERENCE_DATA_KEY.getKey()));

        userPrivVo.setActionType(getReadWriteAction());
        menuPrivVo.setUsingJediForce(userVo.hasPrivilege(userPrivVo));
    }
View Full Code Here

     * rights do.
     *
     * @throws Exception
     */
    public void testUserHasInvalidPrivileges() throws Exception {
        UserPrivilegeVo userPriv = new UserPrivilegeVo();
        userPriv.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                  UserPrivilegeType.Key.MANAGE_REFERENCE_DATA_KEY.getKey()));
        userPriv.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
                                               PrivilegeActionType.Key.READ_KEY.getKey()));

        UserPrivilegeVo allowedPriv = new UserPrivilegeVo();
        allowedPriv.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                     UserPrivilegeType.Key.MANAGE_JUDGE_RESULTS_KEY.getKey()));
        allowedPriv.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
                                                  PrivilegeActionType.Key.READ_KEY.getKey()));

        assertFalse("User should not have had access.", allowedPriv.isPrivileged(userPriv));
    }
View Full Code Here

TOP

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

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.