|
@@ -35,7 +35,15 @@ module.exports = options => {
|
|
|
// 权限控制
|
|
|
const cloneOptions = _.cloneDeep(options);
|
|
|
cloneOptions.uid = this.session.sessionUser.accountId;
|
|
|
- const result = tid ? yield this.service.contractAudit.getDataByCondition(cloneOptions) : false;
|
|
|
+ let result = false;
|
|
|
+ if (tid) {
|
|
|
+ result = yield this.service.contractAudit.getDataByCondition(cloneOptions);
|
|
|
+ } else {
|
|
|
+ const contractPermission = this.subProject.permission.contract_permission;
|
|
|
+ if (contractPermission.length > 0 && _.intersection([3, 4, 5], contractPermission).length > 0) {
|
|
|
+ result = yield this.service.subProjPermission.getContractPermission(contractPermission);
|
|
|
+ }
|
|
|
+ }
|
|
|
// const result = yield this.service.contractAudit.checkPermission(options, this.session.sessionUser.accountId);
|
|
|
if (!result && !this.session.sessionUser.is_admin) {
|
|
|
throw '当前账号权限不足,请联系管理员添加权限';
|