Package org.sete.vo.common

Examples of org.sete.vo.common.UserPrivilegeVo


    // ======================================= Private Methods ==========================================
    // ==================================================================================================


    private void doAuthorization(HttpServletRequest request) throws Exception {
        UserPrivilegeVo vo = new UserPrivilegeVo();
    vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.Key.MANAGE_USERS_KEY.getKey()));
    vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.Key.READ_WRITE_KEY.getKey()));

        checkAuthorization(userHasPrivilege(request.getSession(), vo));
    }
View Full Code Here


    public ActionForward init(ActionMapping mapping,
                              ActionForm form,
                              HttpServletRequest request,
                              HttpServletResponse response) throws Exception {

        UserPrivilegeVo vo = new UserPrivilegeVo();
        vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.SETE_USER_KEY));
        vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));

        checkAuthorization(userHasPrivilege(request.getSession(), vo));

        SeteUserService service = getService(SeteUserService.class);
        List<SeteUserVo> seteUser = service.loadAllSeteUsers();
View Full Code Here

    public ActionForward viewCreateSeteUser(ActionMapping mapping,
                                           ActionForm form,
                                           HttpServletRequest request,
                                           HttpServletResponse response) throws Exception {

        UserPrivilegeVo vo = new UserPrivilegeVo();
        vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.SETE_USER_KEY));
        vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

        checkAuthorization(userHasPrivilege(request.getSession(), vo));

        return mapping.findForward("view");
    }
View Full Code Here

    public ActionForward createSeteUser(ActionMapping mapping,
                                       ActionForm form,
                                       HttpServletRequest request,
                                       HttpServletResponse response) throws Exception {

        UserPrivilegeVo vo = new UserPrivilegeVo();
        vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.SETE_USER_KEY));
        vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

        checkAuthorization(userHasPrivilege(request.getSession(), vo));

        CreateSeteUserForm csuf = (CreateSeteUserForm) form;
View Full Code Here

        SideMenuVo menuPrivVo = new SideMenuVo();
        AuthenticatedUserVo userVo =
                            (AuthenticatedUserVo)request.getSession().getAttribute(WebConstants.AUTH_USER);

        UserPrivilegeVo userPrivVo = new UserPrivilegeVo();
        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_IDEA_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

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

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));

        menuPrivVo.setViewProjectsVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

        menuPrivVo.setViewCreateProjectVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_DOC_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

        menuPrivVo.setUploadDocumentsVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));

        menuPrivVo.setViewMyProjectVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.JUDGE_SCHEDULE_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));

        menuPrivVo.setViewJudgeScheduleVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_SCORE_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

        menuPrivVo.setSubmitJudgingResultsVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_SCORE_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));

        menuPrivVo.setViewJudgingResultsReportVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_SPONSOR_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));

        menuPrivVo.setViewSponsoredProjectsVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.PROJECT_SPONSOR_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

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

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.SETE_USER_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));

        menuPrivVo.setViewUsersVisible(userVo.hasPrivilege(userPrivVo));

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, UserPrivilegeType.SETE_USER_KEY));
        userPrivVo.setActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ_WRITE));

        menuPrivVo.setCreateUsersVisible(userVo.hasPrivilege(userPrivVo));

      
        /* etc etc */
 
View Full Code Here

   */
  public ActionForward init(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {

        UserPrivilegeVo vo = new UserPrivilegeVo();
    vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
        UserPrivilegeType.PROJECT_KEY));
    vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
        PrivilegeActionType.READ));

    checkAuthorization(userHasPrivilege(request.getSession(), vo));

    ScienceProjectService service = getService(ScienceProjectService.class);
View Full Code Here

   */
  public ActionForward viewCreateProject(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {

    UserPrivilegeVo vo = new UserPrivilegeVo();
    vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
        UserPrivilegeType.PROJECT_KEY));
    vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
        PrivilegeActionType.READ_WRITE));

    checkAuthorization(userHasPrivilege(request.getSession(), vo));
    //TO DO - fix for Spring'07 - create VO which holds all the form beans
    ScienceProjectService service = getService(ScienceProjectService.class);
View Full Code Here

   */
  public ActionForward createProject(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {

    UserPrivilegeVo vo = new UserPrivilegeVo();
    vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
        UserPrivilegeType.PROJECT_KEY));
    vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
        PrivilegeActionType.READ_WRITE));

    checkAuthorization(userHasPrivilege(request.getSession(), vo));

        ScienceProjectService service = getService(ScienceProjectService.class);
View Full Code Here

    }
   
//===================== Private Methods =============================

  private void doAuthorization(HttpServletRequest request, boolean readonly) throws PermissionException {
    UserPrivilegeVo vo = new UserPrivilegeVo();
        vo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                            UserPrivilegeType.Key.MANAGE_USERS_KEY.getKey()));
        if(readonly){
          vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
              PrivilegeActionType.Key.READ_KEY.getKey()));         
        }else{
            vo.setActionType(TypeUtil.forKey(PrivilegeActionType.class,
                    PrivilegeActionType.Key.READ_WRITE_KEY.getKey()));         
        }
        checkAuthorization(userHasPrivilege(request.getSession(), vo));
  }
View Full Code Here

    // ==================================================================================================


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

        userPrivVo.setPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class,
                                                    UserPrivilegeType.Key.MANAGE_PROJECT_IDEAS_KEY.getKey()));
        userPrivVo.setActionType(getReadWriteAction());

        menuPrivVo.setCreateProjectIdeaVisible(userVo.hasPrivilege(userPrivVo));
    }
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.