/**
   * 권한별 할당된 롤 목록 조회
   *
   * @param authorRoleManageVO AuthorRoleManageVO
   * @return String
   * @exception Exception
   */
  @RequestMapping(value = "/sec/ram/EgovAuthorRoleList.do")
  public String selectAuthorRoleList(
      @ModelAttribute("authorRoleManageVO") AuthorRoleManageVO authorRoleManageVO, ModelMap model)
      throws Exception {

    /** paging */
    PaginationInfo paginationInfo = new PaginationInfo();
    paginationInfo.setCurrentPageNo(authorRoleManageVO.getPageIndex());
    paginationInfo.setRecordCountPerPage(authorRoleManageVO.getPageUnit());
    paginationInfo.setPageSize(authorRoleManageVO.getPageSize());

    authorRoleManageVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
    authorRoleManageVO.setLastIndex(paginationInfo.getLastRecordIndex());
    authorRoleManageVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());

    authorRoleManageVO.setAuthorRoleList(
        egovAuthorRoleManageService.selectAuthorRoleList(authorRoleManageVO));
    model.addAttribute("authorRoleList", authorRoleManageVO.getAuthorRoleList());

    int totCnt = egovAuthorRoleManageService.selectAuthorRoleListTotCnt(authorRoleManageVO);
    paginationInfo.setTotalRecordCount(totCnt);
    model.addAttribute("paginationInfo", paginationInfo);

    model.addAttribute("message", egovMessageSource.getMessage("success.common.select"));

    return "egovframework/com/sec/ram/EgovAuthorRoleManage";
  }
  /**
   * 권한정보에 롤을 할당하여 데이터베이스에 등록
   *
   * @param authorCode String
   * @param roleCodes String
   * @param regYns String
   * @param authorRoleManage AuthorRoleManage
   * @return String
   * @exception Exception
   */
  @RequestMapping(value = "/sec/ram/EgovAuthorRoleInsert.do")
  public String insertAuthorRole(
      @RequestParam("authorCode") String authorCode,
      @RequestParam("roleCodes") String roleCodes,
      @RequestParam("regYns") String regYns,
      @ModelAttribute("authorRoleManage") AuthorRoleManage authorRoleManage,
      SessionStatus status,
      ModelMap model)
      throws Exception {

    String[] strRoleCodes = roleCodes.split(";");
    String[] strRegYns = regYns.split(";");

    authorRoleManage.setRoleCode(authorCode);

    for (int i = 0; i < strRoleCodes.length; i++) {
      authorRoleManage.setRoleCode(strRoleCodes[i]);
      authorRoleManage.setRegYn(strRegYns[i]);
      if (strRegYns[i].equals("Y")) {
        egovAuthorRoleManageService.deleteAuthorRole(authorRoleManage); // 2011.09.07
        egovAuthorRoleManageService.insertAuthorRole(authorRoleManage);
      } else {
        egovAuthorRoleManageService.deleteAuthorRole(authorRoleManage);
      }
    }

    status.setComplete();
    model.addAttribute("message", egovMessageSource.getMessage("success.common.insert"));
    return "forward:/sec/ram/EgovAuthorRoleList.do";
  }