quick page sharing fix

This commit is contained in:
Philipinho
2026-08-25 01:14:55 +01:00
parent 3e0c3c1234
commit d83ba56180
+9 -4
View File
@@ -46,8 +46,9 @@ export class ShareService {
throw new NotFoundException('Share not found'); throw new NotFoundException('Share not found');
} }
const isRestricted = const isRestricted = await this.pagePermissionRepo.hasRestrictedAncestor(
await this.pagePermissionRepo.hasRestrictedAncestor(share.pageId); share.pageId,
);
if (isRestricted) { if (isRestricted) {
throw new NotFoundException('Share not found'); throw new NotFoundException('Share not found');
} }
@@ -110,6 +111,9 @@ export class ShareService {
} }
async getSharedPage(dto: ShareInfoDto, workspaceId: string) { async getSharedPage(dto: ShareInfoDto, workspaceId: string) {
//TODO: we should resolve the page from the share id
if (!dto.pageId) throw new NotFoundException('Shared page not found');
const share = await this.getShareForPage(dto.pageId, workspaceId); const share = await this.getShareForPage(dto.pageId, workspaceId);
if (!share) { if (!share) {
@@ -126,8 +130,9 @@ export class ShareService {
} }
// Block access to restricted pages // Block access to restricted pages
const isRestricted = const isRestricted = await this.pagePermissionRepo.hasRestrictedAncestor(
await this.pagePermissionRepo.hasRestrictedAncestor(page.id); page.id,
);
if (isRestricted) { if (isRestricted) {
throw new NotFoundException('Shared page not found'); throw new NotFoundException('Shared page not found');
} }