doomiwork 3.7.10 → 3.7.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/controller.js +7 -1
- package/core/database/daoBase.js +2 -1
- package/package.json +1 -1
package/core/controller.js
CHANGED
|
@@ -37,6 +37,12 @@ class controller {
|
|
|
37
37
|
}
|
|
38
38
|
get router() { return this._router; }
|
|
39
39
|
get baseUrl() { return null };
|
|
40
|
+
/**
|
|
41
|
+
* 权限的业务sql过滤
|
|
42
|
+
*/
|
|
43
|
+
PermissonBusiness(req){
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
40
46
|
/**
|
|
41
47
|
* 导出数据到Excel 中
|
|
42
48
|
* @param {*} data
|
|
@@ -217,7 +223,7 @@ class controller {
|
|
|
217
223
|
///将从数据库中获得的结果集根据dataconfig中的配置进行映射转换
|
|
218
224
|
let resultMapping = await parse.transferName2Mapping(result.rows, req.fieldsMapping);
|
|
219
225
|
if (this._daoModel.hasPermissionControl) {
|
|
220
|
-
const accessResult = await this._daoModel.getDataPermissionSetting(req.params.id)
|
|
226
|
+
const accessResult = await this._daoModel.getDataPermissionSetting(req.params.id,this.PermissonBusiness(req))
|
|
221
227
|
if (accessResult.successed) {
|
|
222
228
|
resultMapping.data[0].managepermission = accessResult.managepermission;
|
|
223
229
|
resultMapping.data[0].consumepermission = accessResult.consumepermission;
|
package/core/database/daoBase.js
CHANGED
|
@@ -152,7 +152,7 @@ class mysqlDao extends dao{
|
|
|
152
152
|
* 获取对应数据的权限设置
|
|
153
153
|
* @param {*} id
|
|
154
154
|
*/
|
|
155
|
-
async getDataPermissionSetting(id){
|
|
155
|
+
async getDataPermissionSetting(id,busSql){
|
|
156
156
|
///没有权限控制,则无需获取单条数据的权限因子
|
|
157
157
|
if (!this.hasPermissionControl){
|
|
158
158
|
return null;
|
|
@@ -223,6 +223,7 @@ class mysqlDao extends dao{
|
|
|
223
223
|
where
|
|
224
224
|
data_id=?
|
|
225
225
|
and data_type=?
|
|
226
|
+
${busSql}
|
|
226
227
|
order by allow_type,allow_id
|
|
227
228
|
`
|
|
228
229
|
return this.executeSql(sqlCommand, [id,this.tableoption.permissiondatatype])
|