@RequestMapping(value = "/delete", method = RequestMethod.GET)
  @PreAuthorize("hasRole('CTRL_PERM_DELETE_GET')")
  public String deletePermission(
      @RequestParam(value = "id", required = true) Integer id,
      @RequestParam(value = "phase", required = true) String phase,
      Model model,
      RedirectAttributes redirectAttrs) {

    Permission permission;
    try {
      permission = permissionService.getPermission(id);
    } catch (PermissionNotFoundException e) {
      String message =
          messageSource.getMessage(
              "ctrl.message.error.notfound", new Object[] {"permission id", id}, Locale.US);
      redirectAttrs.addFlashAttribute("error", message);
      return "redirect:/permission/list";
    }

    logger.debug(
        "IN: Permission/delete-GET | id = "
            + id
            + " | phase = "
            + phase
            + " | "
            + permission.toString());

    if (phase.equals(messageSource.getMessage("button.action.cancel", null, Locale.US))) {
      String message =
          messageSource.getMessage(
              "ctrl.message.success.cancel",
              new Object[] {"Delete", businessObject, permission.getPermissionname()},
              Locale.US);
      redirectAttrs.addFlashAttribute("message", message);
      return "redirect:/permission/list";
    } else if (phase.equals(messageSource.getMessage("button.action.stage", null, Locale.US))) {
      logger.debug("     deleting permission : " + permission.toString());
      model.addAttribute("permission", permission);
      return "permission-delete";
    } else if (phase.equals(messageSource.getMessage("button.action.delete", null, Locale.US))) {
      try {
        permissionService.deletePermission(permission.getId());
        String message =
            messageSource.getMessage(
                "ctrl.message.success.delete",
                new Object[] {businessObject, permission.getPermissionname()},
                Locale.US);
        redirectAttrs.addFlashAttribute("message", message);
        return "redirect:/permission/list";
      } catch (PermissionNotFoundException e) {
        String message =
            messageSource.getMessage(
                "ctrl.message.error.notfound", new Object[] {"permission id", id}, Locale.US);
        redirectAttrs.addFlashAttribute("error", message);
        return "redirect:/permission/list";
      }
    }

    return "redirect:/permission/list";
  }
  @RequestMapping(value = "/edit", method = RequestMethod.GET)
  @PreAuthorize("hasRole('CTRL_PERM_EDIT_GET')")
  public String editPermissionPage(
      @RequestParam(value = "id", required = true) Integer id,
      Model model,
      RedirectAttributes redirectAttrs) {

    logger.debug("IN: Permission/edit-GET:  ID to query = " + id);

    try {
      if (!model.containsAttribute("permissionDTO")) {
        logger.debug("Adding permissionDTO object to model");
        Permission perm = permissionService.getPermission(id);
        PermissionDTO permissionDTO = getPermissionDTO(perm);
        logger.debug("Permission/edit-GET:  " + permissionDTO.toString());
        model.addAttribute("permissionDTO", permissionDTO);
      }
      return "permission-edit";
    } catch (PermissionNotFoundException e) {
      String message =
          messageSource.getMessage(
              "ctrl.message.error.notfound", new Object[] {"user id", id}, Locale.US);
      model.addAttribute("error", message);
      return "redirect:/permission/list";
    }
  }