Forráskód Böngészése

动态投资,授权查询相关

MaiXinRong 4 hónapja
szülő
commit
00b19aaa52
2 módosított fájl, 1 hozzáadás és 8 törlés
  1. 1 7
      app/middleware/budget_check.js
  2. 0 1
      app/view/sp_setting/permission.ejs

+ 1 - 7
app/middleware/budget_check.js

@@ -28,13 +28,7 @@ module.exports = options => {
             if (!this.budget) throw '未设置概预算标准';
             if (this.budget.pid !== this.session.sessionProject.id) throw '您无权查看该项目';
 
-            if (this.session.sessionUser.is_admin) {
-                this.budget.readOnly = false;
-            } else {
-                const bp = yield this.service.subProjPermission.getBudgetUserPermission(id);
-                if (!bp) throw '您无权查看该项目动态投资数据';
-                this.budget.readOnly = bp.budget_permission.indexOf(this.service.subProjPermission.PermissionConst.budget.edit.value) < 0;
-            }
+            this.budget.readOnly = this.subProject.permission.budget_permission.indexOf(this.service.subProjPermission.PermissionConst.budget.edit.value) < 0;
             yield next;
         } catch (err) {
             this.log(err);

+ 0 - 1
app/view/sp_setting/permission.ejs

@@ -66,7 +66,6 @@
                                             </thead>
                                             <tbody class="text-center">
                                             <% for (const user of subProjectAccountList) { %>
-                                            <% console.log(user); %>
                                             <% const tp = user[ptype + '_permission'].split(','); %>
                                             <tr name="user-permission" pid="<%- user.permission_id %>">
                                                 <td><%- user.name %></td>