Пример #1
0
 @RequestMapping("/editPermission")
 public @ResponseBody String editPermission(Permission permission) {
   SecurityUtils.getSubject().checkPermission("shiro/permission:update");
   permissionService.updatePermission(permission);
   String stringView = JsonUtil.getJsonStr(AjaxResult.SUCCESS);
   return stringView;
 }
Пример #2
0
 @RequestMapping("/permissionList")
 public @ResponseBody String permissionList(PermissionForm permissionForm) {
   SecurityUtils.getSubject().checkPermission("shiro/permission:list");
   DataGridResult dataGridResult = permissionService.listPermission(permissionForm);
   String stringView = JsonUtil.getJsonStr(dataGridResult);
   return stringView;
 }
Пример #3
0
 @RequestMapping(value = "/allPermissions", method = RequestMethod.GET)
 public @ResponseBody String allPermissions(@RequestParam String roleId) {
   //        SecurityUtils.getSubject().checkPermission("shiro/permission:allPermissions");
   System.out.println(
       "------------------------------------------"
           + roleId
           + "-----------------------------------------------------------");
   Long rId = Long.valueOf(roleId);
   DataGridResult dataGridResult = permissionService.getAllPermissions(rId);
   String stringView = JsonUtil.getJsonStr(dataGridResult);
   return stringView;
 }
Пример #4
0
 @RequestMapping(value = "/delete", method = RequestMethod.POST)
 public @ResponseBody String deletePermission(@RequestParam String permissionIds) {
   SecurityUtils.getSubject().checkPermission("shiro/permission:delete");
   String[] strIds = permissionIds.split(",");
   Long[] permissionsId = new Long[strIds.length];
   for (int i = 0; i < strIds.length; i++) {
     permissionsId[i] = Long.valueOf(strIds[i]);
   }
   permissionService.deletePermission(permissionsId);
   String stringView = JsonUtil.getJsonStr(AjaxResult.SUCCESS);
   return stringView;
 }