make shares/info endpoint public

This commit is contained in:
Philipinho
2025-04-22 15:13:33 +01:00
parent f74688663d
commit 07ed1a6a78

View File

@ -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;
}