-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getDeptIds(UserDto user)提取的机构权限错乱, 这个方法绝对是不稳定的 , 给的逻辑不对 ❌ #801
Comments
LonelyTear
changed the title
getDeptIds提取的机构权限错乱(视频后续提供)❌
getDeptIds(UserDto user)提取的机构权限错乱, 这个方法绝对是不稳定的 , 给的逻辑不对 ❌
Jul 3, 2023
elunez
added a commit
to elunez/eladmin-mp
that referenced
this issue
Jul 4, 2023
elunez
added a commit
to elunez/eladmin-mp
that referenced
this issue
Jul 4, 2023
This reverts commit 047b832.
elunez
added a commit
to elunez/eladmin-mp
that referenced
this issue
Jul 4, 2023
感谢,已修复 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🚩问题描述: getDeptIds(UserDto user)这个方法绝对是不稳定的 , 给的逻辑不对
🚩版本: 不知道这项目的版本在哪看, 总之2023/07/03 18:00:00 的时候还是这样子的
🚩环境:本地/线上
🚩复现步骤:
根据用户查角色没有按角色级别排序 , 默认按的角色id大小排的正序 ,
当查出的角色顺序是 本级 , 全部 , 自定义 , 则用户只有本级机构权限;
当查出的角色顺序是 自定义 , 全部 , 本级 , 则用户只有自定义机构权限;
当查出的角色顺序是 自定义1, 全部, 自定义2 , 自定义3 , 则用户只有自定义1的机构权限,
追加一堆角色会导致机构权限乱七八糟的! 一会有这个机构权限, 一会没有的那个机构权限.
总结 : 遇到全部就会直接退出循环, 把最近累计的机构返回 , 这一点和只有一个"全部"这个类型的的角色时返回的空机构相违背.
🚩代码位置: https://github.com/elunez/eladmin/blob/master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java
🚩日志提供:直接看视频↓
🚩视频🎬: 【eladmin角色机构权限bug-哔哩哔哩】 https://b23.tv/PRAr9Xx
🚩代码说明:
如果按照作者的本意设计, 遇到"全部"这个类型的角色就不返回机构编码的话, 那
应该改成
最终像下面这样才合理
The text was updated successfully, but these errors were encountered: