forked from github/dataease
fix:视图按钮权限控制,同步在仪表板编辑时也适用
This commit is contained in:
parent
594d20eb4d
commit
5c98e39451
@ -65,4 +65,9 @@ public class ChartViewController {
|
||||
public String searchAdviceSceneId(@PathVariable String panelId){
|
||||
return chartViewService.searchAdviceSceneId(panelId);
|
||||
}
|
||||
|
||||
@PostMapping("/getOneWithPermission/{id}")
|
||||
public ChartViewDTO getOneWithPermission(@PathVariable String id, @RequestBody ChartExtRequest requestList) throws Exception {
|
||||
return chartViewService.getData(id, requestList);
|
||||
}
|
||||
}
|
||||
|
@ -315,6 +315,12 @@ public class ChartViewService {
|
||||
BeanUtils.copyBean(dto, view);
|
||||
dto.setData(map);
|
||||
dto.setSql(datasourceRequest.getQuery());
|
||||
|
||||
//如果能获取用户 则添加对应的权限
|
||||
if(AuthUtils.getUser()!=null){
|
||||
ChartViewDTO permissionDto = getOneWithPermission(dto.getId());
|
||||
dto.setPrivileges(permissionDto.getPrivileges());
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ export function post(url, data) {
|
||||
|
||||
export function ajaxGetData(id, data) {
|
||||
return request({
|
||||
url: '/chart/view/getData/' + id,
|
||||
url: '/chart/view/getOneWithPermission/' + id,
|
||||
method: 'post',
|
||||
loading: true,
|
||||
hideMsg: true,
|
||||
|
@ -902,6 +902,7 @@ export default {
|
||||
this.data = response.data.data
|
||||
// console.log(JSON.stringify(this.chart))
|
||||
this.httpRequest.status = true
|
||||
this.param.privileges = this.chart.privileges
|
||||
}).catch(err => {
|
||||
this.resetView()
|
||||
this.httpRequest.status = err.response.data.success
|
||||
|
Loading…
Reference in New Issue
Block a user