diff --git a/packages/server/src/services/document.service.ts b/packages/server/src/services/document.service.ts index 94ca729e..9edf7e18 100644 --- a/packages/server/src/services/document.service.ts +++ b/packages/server/src/services/document.service.ts @@ -701,6 +701,7 @@ export class DocumentService { * @param keyword */ async search(user, organizationId, keyword) { + const userId = user.id; const res = await this.documentRepo .createQueryBuilder('document') .andWhere('document.organizationId = :organizationId') @@ -712,7 +713,7 @@ export class DocumentService { const ret = await Promise.all( res.map(async (doc) => { - const auth = await this.authService.getAuth(user.Id, { + const auth = await this.authService.getAuth(userId, { organizationId: doc.organizationId, wikiId: doc.wikiId, documentId: doc.id,