fix: 视图中数据集权限校验

This commit is contained in:
junjie 2021-07-22 18:59:36 +08:00
parent 06e1fbde14
commit b7936b91f9
5 changed files with 6 additions and 19 deletions

View File

@ -180,10 +180,10 @@ public class ChartViewService {
} }
} }
// 获取数据集 // 获取数据集,需校验权限
DatasetTable table = dataSetTableService.get(view.getTableId()); DatasetTable table = dataSetTableService.getWithPermission(view.getTableId());
if (ObjectUtils.isEmpty(table)) { if (ObjectUtils.isEmpty(table)) {
throw new RuntimeException(Translator.get("i18n_dataset_delete")); throw new RuntimeException(Translator.get("i18n_dataset_delete_or_no_permission"));
} }
// 判断连接方式直连或者定时抽取 table.mode // 判断连接方式直连或者定时抽取 table.mode
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();

View File

@ -251,7 +251,7 @@ i18n_datasource_not_allow_delete_msg= datasets are using this data source and ca
i18n_task_name_repeat=Name is used in same data set i18n_task_name_repeat=Name is used in same data set
i18n_id_or_pwd_error=Invalid ID or password i18n_id_or_pwd_error=Invalid ID or password
i18n_datasource_delete=Data source is delete i18n_datasource_delete=Data source is delete
i18n_dataset_delete=Data set is delete i18n_dataset_delete_or_no_permission=Data set is delete or no permission
i18n_chart_delete=Chart is delete i18n_chart_delete=Chart is delete
i18n_not_exec_add_sync=There is no completed synchronization task. Incremental synchronization cannot be performed i18n_not_exec_add_sync=There is no completed synchronization task. Incremental synchronization cannot be performed
i18n_excel_header_empty=Excel first row can not empty i18n_excel_header_empty=Excel first row can not empty

View File

@ -250,7 +250,7 @@ i18n_datasource_not_allow_delete_msg= 个数据集正在使用此数据源,无
i18n_task_name_repeat=同一数据集下任务名称已被使用 i18n_task_name_repeat=同一数据集下任务名称已被使用
i18n_id_or_pwd_error=无效的ID或密码 i18n_id_or_pwd_error=无效的ID或密码
i18n_datasource_delete=当前用到的数据源已被删除 i18n_datasource_delete=当前用到的数据源已被删除
i18n_dataset_delete=当前用到的数据集已被删除 i18n_dataset_delete_or_no_permission=当前用到的数据集没有权限或已被删除
i18n_chart_delete=当前用到的视图已被删除 i18n_chart_delete=当前用到的视图已被删除
i18n_not_exec_add_sync=没有已完成的同步任务,无法进行增量同步 i18n_not_exec_add_sync=没有已完成的同步任务,无法进行增量同步
i18n_excel_header_empty=Excel第一行为空 i18n_excel_header_empty=Excel第一行为空

View File

@ -253,7 +253,7 @@ i18n_datasource_not_allow_delete_msg= 個數據集正在使用此數據源,無
i18n_task_name_repeat=同一數據集下任務名稱已被使用 i18n_task_name_repeat=同一數據集下任務名稱已被使用
i18n_id_or_pwd_error=無效的ID或密碼 i18n_id_or_pwd_error=無效的ID或密碼
i18n_datasource_delete=當前用到的數據源已被刪除 i18n_datasource_delete=當前用到的數據源已被刪除
i18n_dataset_delete=當前用到的數據集已被刪除 i18n_dataset_delete_or_no_permission=當前用到的數據集沒有權限或已被刪除
i18n_chart_delete=當前用到的視圖已被刪除 i18n_chart_delete=當前用到的視圖已被刪除
i18n_not_exec_add_sync=沒有已經完成的同步任務,無法進行增量同步 i18n_not_exec_add_sync=沒有已經完成的同步任務,無法進行增量同步
i18n_excel_header_empty=Excel第一行為空 i18n_excel_header_empty=Excel第一行為空

View File

@ -709,19 +709,6 @@ export default {
this.httpRequest.msg = err.response.data.message this.httpRequest.msg = err.response.data.message
return true return true
}) })
} else {
post('/dataset/table/getFieldsFromDE', { id: id }).then(response => {
this.dimension = response.data.dimension
this.quota = response.data.quota
this.dimensionData = JSON.parse(JSON.stringify(this.dimension))
this.quotaData = JSON.parse(JSON.stringify(this.quota))
this.fieldFilter(this.searchField)
}).catch(err => {
this.resetView()
this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err.response.data.message
return true
})
} }
}, },
save(getData, trigger, needRefreshGroup = false) { save(getData, trigger, needRefreshGroup = false) {