diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java index 2ea1956..5eedcda 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java @@ -20,6 +20,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.stream.Collectors; @Controller @RequestMapping("/system/userexamine") @@ -27,6 +28,10 @@ public class SysUserExamineController extends BaseController { private String prefix = "system/user/userexamine"; @Autowired private ISysUserService userService; + @Autowired + private ISysRoleService roleService; + @Autowired + private ISysPostService postService; @RequiresPermissions("system:userexamine:view") @GetMapping() public String user() @@ -56,7 +61,11 @@ public class SysUserExamineController extends BaseController { @GetMapping("/examine/{userId}") public String userExamine(@PathVariable("userId") Long userId, ModelMap mmap) { + userService.checkUserDataScope(userId); + List roles = roleService.selectRolesByUserId(userId); mmap.put("user", userService.selectUserById(userId)); + mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); + mmap.put("posts", postService.selectPostsByUserId(userId)); return prefix + "/examinedetail"; }