elunez / eladmin-doc

EL-ADMIN 文档源码
https://eladmin.vip
Apache License 2.0
175 stars 346 forks source link

[Vssue]数据权限 | EL-ADMIN 在线文档 #67

Closed elunez closed 2 years ago

elunez commented 2 years ago

https://el-admin.vip/pages/010207/

jiangenliang commented 2 years ago

List dataScopes = SecurityUtils.getCurrentUserDataScope(); if(CollectionUtil.isNotEmpty(dataScopes)){ if(StringUtils.isNotBlank(permission.joinName()) && StringUtils.isNotBlank(permission.fieldName())) { Join join = root.join(permission.joinName(), JoinType.LEFT); list.add(getExpression(permission.fieldName(),join, root).in(dataScopes)); } else if (StringUtils.isBlank(permission.joinName()) && StringUtils.isNotBlank(permission.fieldName())) { list.add(getExpression(permission.fieldName(),null, root).in(dataScopes)); } }

如果dataScopes是空,是不是意味着当前登录的用户没有权限查阅目标数据,最后应该是返回空,但是if里面的代码段被跳过,那筛选条件里就没有水平权限了吧?