mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
update 优化 脱敏增加角色及权限校验
This commit is contained in:
parent
8a00416c40
commit
a619d2de51
@ -26,19 +26,16 @@ public class SysSensitiveServiceImpl implements SensitiveService {
|
||||
if (!StpUtil.isLogin()){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(roleKey) && StringUtils.isNotEmpty(perms)){
|
||||
boolean roleExist = StringUtils.isNotEmpty(roleKey);
|
||||
boolean permsExist = StringUtils.isNotEmpty(perms);
|
||||
if (roleExist && permsExist){
|
||||
if (StpUtil.hasRole(roleKey) && StpUtil.hasPermission(perms)){
|
||||
return false;
|
||||
}
|
||||
}else if (StringUtils.isNotEmpty(roleKey)){
|
||||
if (StpUtil.hasRole(roleKey)){
|
||||
return false;
|
||||
}
|
||||
}else if (StringUtils.isNotEmpty(perms)){
|
||||
if (StpUtil.hasPermission(perms)){
|
||||
return false;
|
||||
}
|
||||
}else if (roleExist && StpUtil.hasRole(roleKey)){
|
||||
return false;
|
||||
}else if (permsExist && StpUtil.hasPermission(perms)){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TenantHelper.isEnable()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user