小组应用小组用户权限缓存应用权限调整
This commit is contained in:
parent
e277d25125
commit
21d6d6cce2
@ -7,6 +7,8 @@ import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.constant.Constant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppProfile;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
||||
import com.actionsoft.bpms.commons.cache.Cache;
|
||||
import com.actionsoft.bpms.commons.cache.CacheManager;
|
||||
@ -75,6 +77,9 @@ public class CooperationCache extends Cache<String, TeamInfo> {
|
||||
*/
|
||||
public static UserInfo getUserInfo(String teamId,String userid){
|
||||
TeamInfo teamInfo = getCache().get(teamId);
|
||||
if (null == teamInfo){
|
||||
return null;
|
||||
}
|
||||
for (UserInfo user : teamInfo.getUsers()) {
|
||||
if (user.getUserid().equals(userid)){
|
||||
return user;
|
||||
@ -137,9 +142,10 @@ public class CooperationCache extends Cache<String, TeamInfo> {
|
||||
* 根据小组与用户id获取用户数据访问权限
|
||||
* @param teamId
|
||||
* @param userid
|
||||
* @param isValidPermData 查询使用中的文件标志,true:过滤掉进入回收站的数据,false:查询全部权限数据
|
||||
* @return
|
||||
*/
|
||||
public static Set<String> getUserDataVisitablePermission(String teamId,String userid){
|
||||
public static Set<String> getUserDataVisitablePermission(String teamId,String userid,boolean isValidPermData){
|
||||
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
|
||||
if (null == userInfo){
|
||||
return new HashSet<>();
|
||||
@ -148,7 +154,20 @@ public class CooperationCache extends Cache<String, TeamInfo> {
|
||||
TeamInfo teamInfo = CooperationCache.getTeamInfo(teamId);
|
||||
return teamInfo.getVersionIds();
|
||||
}
|
||||
return userInfo.getDataPermission().keySet();
|
||||
Set<String> set = new HashSet<>();
|
||||
Set<String> keySet = userInfo.getDataPermission().keySet();
|
||||
for (String next : keySet) {
|
||||
if (isValidPermData) {
|
||||
// 在流程表的校验,抛弃回收站中删除文件
|
||||
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(next);
|
||||
if (verModels != null && verModels.size() > 0) {
|
||||
set.add(next);
|
||||
}
|
||||
}else {
|
||||
set.add(next);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user