fix(资料中心): 80856
This commit is contained in:
+7
-4
@@ -22,12 +22,11 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -48,6 +47,8 @@ public class LawsDataCenterFolderServiceImpl extends ServiceImpl<LawsDataCenterF
|
||||
private ILawsDataCenterFileService lawsDataCenterFileService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Value("${adminRoleCode}")
|
||||
private String adminRoleCode;
|
||||
|
||||
/**
|
||||
* @Author: liao
|
||||
@@ -64,7 +65,9 @@ public class LawsDataCenterFolderServiceImpl extends ServiceImpl<LawsDataCenterF
|
||||
List<LawsDataCenterFolder> allList = BeanCopyUtils.copyBeanList(lawsDataCenterFolderList, LawsDataCenterFolder.class);
|
||||
|
||||
// 非管理员只能看到自己创建的 or 拥有管理权限 or 拥有查看权限的文件夹 or 默认根目录
|
||||
if (!roleIds.contains("admin")){
|
||||
List<String> adminRoleCodeList = Arrays.asList(adminRoleCode.split(","));
|
||||
Collection<String> intersection = CollectionUtils.intersection(Arrays.asList(roleIds.split(",")), adminRoleCodeList);
|
||||
if (!roleIds.contains("admin") && CollectionUtils.isEmpty(intersection)){
|
||||
lawsDataCenterFolderList = lawsDataCenterFolderList.stream()
|
||||
.filter(v -> (StringUtils.isNotBlank(v.getAuthManageIds()) && v.getAuthManageIds().contains(loginUser.getId()))
|
||||
|| (StringUtils.isNotBlank(v.getAuthViewIds()) && v.getAuthViewIds().contains(loginUser.getId()))
|
||||
|
||||
Reference in New Issue
Block a user