mirror of https://github.com/fantasticit/think.git
fix: update guard message
parent
6496422754
commit
dbbb7ead56
|
@ -49,12 +49,12 @@ export class DocumentAuthorityGuard implements CanActivate {
|
|||
|
||||
if (needAuth === 'createUser') {
|
||||
if (document.createUserId !== user.id) {
|
||||
throw new HttpException('您不是该文档的创建者,无法删除', HttpStatus.FORBIDDEN);
|
||||
throw new HttpException('您不是该文档的创建者,无法操作', HttpStatus.FORBIDDEN);
|
||||
}
|
||||
} else if (needAuth) {
|
||||
const authority = await this.documentService.getDocumentAuthority(documentId, user.id);
|
||||
if (!authority || !authority[needAuth]) {
|
||||
throw new HttpException('您无权查看此文档', HttpStatus.FORBIDDEN);
|
||||
throw new HttpException('您无权操作此文档', HttpStatus.FORBIDDEN);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ export class WikiUserRoleGuard implements CanActivate {
|
|||
const wikiUser = await this.wikiService.findWikiUser(wikiId, user.id);
|
||||
|
||||
if (!wikiUser && targetUserRole && wikiUser.userRole !== targetUserRole) {
|
||||
throw new HttpException('您无权查看该知识库', HttpStatus.FORBIDDEN);
|
||||
throw new HttpException('您无权操作该知识库', HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue