fix(server): fix authority check

This commit is contained in:
fantasticit 2022-02-22 23:35:46 +08:00
parent c12e6b1bb2
commit 1c21079dcd
1 changed files with 1 additions and 3 deletions

View File

@ -630,7 +630,7 @@ export class DocumentService {
userId: user.id,
});
if (!authority || !authority.editable) {
if (!authority || !authority.readable) {
throw new HttpException(
'您无权查看该文档下的子文档',
HttpStatus.FORBIDDEN,
@ -686,8 +686,6 @@ export class DocumentService {
}) {
const { wikiId, documentId } = data;
console.log('share');
const document = documentId
? await this.documentRepo.findOne(documentId)
: await this.documentRepo.findOne({ wikiId, isWikiHome: true });