From 07ed1a6a7876f4ee3e3915b7f3ab27186a20f6d6 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:13:33 +0100 Subject: [PATCH] make shares/info endpoint public --- apps/server/src/core/share/share.controller.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/server/src/core/share/share.controller.ts b/apps/server/src/core/share/share.controller.ts index 6ea13799..5e8debe0 100644 --- a/apps/server/src/core/share/share.controller.ts +++ b/apps/server/src/core/share/share.controller.ts @@ -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; }