HttpServletRequest request,
HttpServletResponse response,
ServletContext servletCtx) throws Exception {
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 */
request.setAttribute(WebConstants.SIDE_MENU_VO, menuPrivVo);
}