forked from github/dataease
fix: 公共链接行权限
This commit is contained in:
parent
96a830ebaf
commit
6bb37f0d4e
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import io.dataease.auth.api.dto.CurrentRoleDto;
|
import io.dataease.auth.api.dto.CurrentRoleDto;
|
||||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||||
|
import io.dataease.auth.entity.SysUserEntity;
|
||||||
import io.dataease.auth.service.AuthUserService;
|
import io.dataease.auth.service.AuthUserService;
|
||||||
import io.dataease.base.domain.*;
|
import io.dataease.base.domain.*;
|
||||||
import io.dataease.base.mapper.*;
|
import io.dataease.base.mapper.*;
|
||||||
@ -455,16 +456,26 @@ public class DataSetTableService {
|
|||||||
}
|
}
|
||||||
RowPermissionService rowPermissionService = SpringContextUtil.getBean(RowPermissionService.class);
|
RowPermissionService rowPermissionService = SpringContextUtil.getBean(RowPermissionService.class);
|
||||||
CurrentUserDto user = AuthUtils.getUser();
|
CurrentUserDto user = AuthUtils.getUser();
|
||||||
userId = user != null ? user.getUserId() : userId;
|
|
||||||
List<Long> roleIds;
|
List<Long> roleIds;
|
||||||
Long deptId;
|
Long deptId;
|
||||||
if (user != null) {
|
|
||||||
|
if(user == null){
|
||||||
|
SysUserEntity userEntity = authUserService.getUserById(userId);
|
||||||
|
if(userEntity.getIsAdmin()){
|
||||||
|
return datasetRowPermissions;
|
||||||
|
}
|
||||||
|
deptId = userEntity.getDeptId();
|
||||||
|
roleIds = authUserService.roles(userId).stream().map(r -> Long.valueOf(r)).collect(Collectors.toList());
|
||||||
|
}else {
|
||||||
|
if(user.getIsAdmin()){
|
||||||
|
return datasetRowPermissions;
|
||||||
|
}
|
||||||
|
userId = user.getUserId();
|
||||||
deptId = user.getDeptId();
|
deptId = user.getDeptId();
|
||||||
roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList());
|
roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList());
|
||||||
} else {
|
|
||||||
deptId = authUserService.getUserById(userId).getDeptId();
|
|
||||||
roleIds = authUserService.roles(userId).stream().map(r -> Long.valueOf(r)).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
|
userId = user != null ? user.getUserId() : userId;
|
||||||
|
|
||||||
DataSetRowPermissionsDTO dataSetRowPermissionsDTO = new DataSetRowPermissionsDTO();
|
DataSetRowPermissionsDTO dataSetRowPermissionsDTO = new DataSetRowPermissionsDTO();
|
||||||
dataSetRowPermissionsDTO.setDatasetId(datasetId);
|
dataSetRowPermissionsDTO.setDatasetId(datasetId);
|
||||||
dataSetRowPermissionsDTO.setAuthTargetIds(Collections.singletonList(userId));
|
dataSetRowPermissionsDTO.setAuthTargetIds(Collections.singletonList(userId));
|
||||||
|
@ -78,6 +78,7 @@ export default {
|
|||||||
if (data) {
|
if (data) {
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
item.type !== 'custom' && (item.id = uuid.v1())
|
item.type !== 'custom' && (item.id = uuid.v1())
|
||||||
|
item.user = this.user
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
Loading…
Reference in New Issue
Block a user