在学习用户管理时遇到了问题,希望大家讲解一下这段代码,文字描述一下。谢谢!
/**
* 角色分配权限
*/
@GetMapping("/authDataScope/{roleId}")
public String authDataScope(@PathVariable("roleId") Long roleId, ModelMap mmap)
{
mmap.put("role", roleService.selectRoleById(roleId));
return prefix + "/dataScope";
}
/**
* 保存角色分配权限
*/
@RequiresPermissions("system:role:edit")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PostMapping("/authDataScope")
@ResponseBody
public AjaxResult authDataScopeSave(Role role)
{
roleService.checkRoleAllowed(role);
if (roleService.authDataScope(role) > 0)
{
setSysUser(userService.selectUserById(getSysUser().getUserId()));
return success();
}
return error();
}