mirror of
https://github.com/docmost/docmost.git
synced 2025-11-18 04:01:12 +10:00
make shares/info endpoint public
This commit is contained in:
@ -64,9 +64,10 @@ export class ShareController {
|
||||
return this.shareService.getSharedPage(dto, workspace.id);
|
||||
}
|
||||
|
||||
@Public()
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Post('/info')
|
||||
async getShare(@Body() dto: ShareIdDto, @AuthUser() user: User) {
|
||||
async getShare(@Body() dto: ShareIdDto) {
|
||||
const share = await this.shareRepo.findById(dto.shareId, {
|
||||
includeSharedPage: true,
|
||||
});
|
||||
@ -75,11 +76,6 @@ export class ShareController {
|
||||
throw new NotFoundException('Share not found');
|
||||
}
|
||||
|
||||
const ability = await this.spaceAbility.createForUser(user, share.spaceId);
|
||||
if (ability.cannot(SpaceCaslAction.Read, SpaceCaslSubject.Share)) {
|
||||
throw new ForbiddenException();
|
||||
}
|
||||
|
||||
return share;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user