add permission

pull/511/MERGE
RuoYi 2024-12-30 12:12:49 +08:00
parent d672512b6e
commit 0a352ed2b4
12 changed files with 19 additions and 14 deletions

View File

@ -139,8 +139,7 @@ public class CommonController
* *
*/ */
@GetMapping("/download/resource") @GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) throws Exception
throws Exception
{ {
try try
{ {

View File

@ -68,6 +68,7 @@ public class SysConfigController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:config:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {

View File

@ -54,6 +54,7 @@ public class SysDeptController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:dept:add")
@GetMapping("/add/{parentId}") @GetMapping("/add/{parentId}")
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
{ {
@ -163,9 +164,9 @@ public class SysDeptController extends BaseController
* @param deptId ID * @param deptId ID
* @param excludeId ID * @param excludeId ID
*/ */
@RequiresPermissions("system:dept:list")
@GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" }) @GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" })
public String selectDeptTree(@PathVariable("deptId") Long deptId, public String selectDeptTree(@PathVariable("deptId") Long deptId, @PathVariable(value = "excludeId", required = false) Long excludeId, ModelMap mmap)
@PathVariable(value = "excludeId", required = false) Long excludeId, ModelMap mmap)
{ {
mmap.put("dept", deptService.selectDeptById(deptId)); mmap.put("dept", deptService.selectDeptById(deptId));
mmap.put("excludeId", excludeId); mmap.put("excludeId", excludeId);
@ -175,6 +176,7 @@ public class SysDeptController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:dept:list")
@GetMapping("/treeData/{excludeId}") @GetMapping("/treeData/{excludeId}")
@ResponseBody @ResponseBody
public List<Ztree> treeDataExcludeChild(@PathVariable(value = "excludeId", required = false) Long excludeId) public List<Ztree> treeDataExcludeChild(@PathVariable(value = "excludeId", required = false) Long excludeId)

View File

@ -65,6 +65,7 @@ public class SysDictDataController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:dict:add")
@GetMapping("/add/{dictType}") @GetMapping("/add/{dictType}")
public String add(@PathVariable("dictType") String dictType, ModelMap mmap) public String add(@PathVariable("dictType") String dictType, ModelMap mmap)
{ {

View File

@ -67,6 +67,7 @@ public class SysDictTypeController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:dict:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {
@ -167,8 +168,7 @@ public class SysDictTypeController extends BaseController
* *
*/ */
@GetMapping("/selectDictTree/{columnId}/{dictType}") @GetMapping("/selectDictTree/{columnId}/{dictType}")
public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType, public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType, ModelMap mmap)
ModelMap mmap)
{ {
mmap.put("columnId", columnId); mmap.put("columnId", columnId);
mmap.put("dict", dictTypeService.selectDictTypeByType(dictType)); mmap.put("dict", dictTypeService.selectDictTypeByType(dictType));

View File

@ -77,6 +77,7 @@ public class SysMenuController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:menu:add")
@GetMapping("/add/{parentId}") @GetMapping("/add/{parentId}")
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
{ {

View File

@ -56,6 +56,7 @@ public class SysNoticeController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:notice:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {

View File

@ -67,20 +67,14 @@ public class SysPostController extends BaseController
@PostMapping("/remove") @PostMapping("/remove")
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids)
{
try
{ {
return toAjax(postService.deletePostByIds(ids)); return toAjax(postService.deletePostByIds(ids));
} }
catch (Exception e)
{
return error(e.getMessage());
}
}
/** /**
* *
*/ */
@RequiresPermissions("system:post:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {

View File

@ -77,6 +77,7 @@ public class SysRoleController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:role:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {
@ -275,6 +276,7 @@ public class SysRoleController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:role:list")
@GetMapping("/authUser/selectUser/{roleId}") @GetMapping("/authUser/selectUser/{roleId}")
public String selectUser(@PathVariable("roleId") Long roleId, ModelMap mmap) public String selectUser(@PathVariable("roleId") Long roleId, ModelMap mmap)
{ {

View File

@ -113,6 +113,7 @@ public class SysUserController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:user:add")
@GetMapping("/add") @GetMapping("/add")
public String add(ModelMap mmap) public String add(ModelMap mmap)
{ {
@ -242,6 +243,7 @@ public class SysUserController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("system:user:edit")
@GetMapping("/authRole/{userId}") @GetMapping("/authRole/{userId}")
public String authRole(@PathVariable("userId") Long userId, ModelMap mmap) public String authRole(@PathVariable("userId") Long userId, ModelMap mmap)
{ {

View File

@ -91,6 +91,7 @@ public class ${ClassName}Controller extends BaseController
/** /**
* 新增${functionName} * 新增${functionName}
*/ */
@RequiresPermissions("${permissionPrefix}:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {

View File

@ -118,6 +118,7 @@ public class SysJobController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("monitor:job:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {