提交 5d234097 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 数据集消息获取接受人权限错误

上级 e3cff226
......@@ -43,9 +43,11 @@ public class ExtAuthServiceImpl implements ExtAuthService {
@Override
public AuthURD resourceTarget(String resourceId) {
AuthURD authURD = new AuthURD();
SysAuthExample example = new SysAuthExample();
/*SysAuthExample example = new SysAuthExample();
example.createCriteria().andAuthSourceEqualTo(resourceId);
List<SysAuth> sysAuths = sysAuthMapper.selectByExample(example);
List<SysAuth> sysAuths = sysAuthMapper.selectByExample(example);*/
List<SysAuth> sysAuths = extAuthMapper.queryByResource(resourceId);
Map<String, List<SysAuth>> authMap = sysAuths.stream().collect(Collectors.groupingBy(SysAuth::getAuthTargetType));
if (!CollectionUtils.isEmpty(authMap.get("user"))) {
authURD.setUserIds(authMap.get("user").stream().map(item -> Long.parseLong(item.getAuthTarget())).collect(Collectors.toList()));
......
package io.dataease.base.mapper.ext;
import io.dataease.base.domain.SysAuth;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -12,6 +13,6 @@ public interface ExtAuthMapper {
List<Long> queryUserIdWithDeptIds(@Param("deptIds") List<Long> deptIds);
List<SysAuth> queryByResource(@Param("resourceId") String resourceId);
// Set<Long> queryUserIdWithRD(@Param("roleIds") List<Long> roleIds, @Param("deptIds") List<Long> deptIds);
}
......@@ -23,5 +23,12 @@
</select>
<select id="queryByResource" resultMap="io.dataease.base.mapper.SysAuthMapper.BaseResultMap" >
select a.*
from sys_auth a left join sys_auth_detail b on a.id = b.auth_id
where a.auth_source = #{resourceId} and b.privilege_value = 1
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论