fix: 在线用户根据角色数据权限范围隔离

This commit is contained in:
TsMask committed 2024-07-08 11:40:50 +08:00
1 parent 7255cc1d92
commit d82721f5fa
1 file changed
+1 -1
@@ -67,7 +67,7 @@ func (s *SysUserOnlineController) List(c *gin.Context) {
if currentRoleDataScope == roledatascope.DEPT && loginUser.DeptID == currentUser.DeptID {
return true
}
if currentRoleDataScope == roledatascope.DEPT_AND_CHILD && strings.Contains(loginUser.User.Dept.Ancestors, currentUser.DeptID) {
if currentRoleDataScope == roledatascope.DEPT_AND_CHILD && (strings.Contains(loginUser.User.Dept.Ancestors, currentUser.DeptID) || currentUser.DeptID == loginUser.DeptID) {
return true
}
if currentRoleDataScope == roledatascope.SELF && loginUser.UserID == currentUser.UserID {