|
@@ -26,11 +26,11 @@ module.exports = app => {
|
|
|
|
|
|
async getSubProject(pid, uid, admin, filterFolder = false) {
|
|
|
let result = await this.getAllDataByCondition({ where: { project_id: pid, is_delete: 0 } });
|
|
|
- if (admin) return result;
|
|
|
|
|
|
const permission = await this.ctx.service.subProjPermission.getUserPermission(pid, uid);
|
|
|
result = result.filter(x => {
|
|
|
if (x.is_folder) return !filterFolder;
|
|
|
+ if (admin) return true;
|
|
|
const pb = permission.find(y => { return x.id === y.spid});
|
|
|
if (!pb) return false;
|
|
|
x.user_permission = pb;
|