Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

project unpin access control

Blue Mouse62da04e8f22e
diff --git a/backend/apps/cloud/src/project/project.controller.ts b/backend/apps/cloud/src/project/project.controller.ts
index 0935ba30a..90c78409f 100644
--- a/backend/apps/cloud/src/project/project.controller.ts
+++ b/backend/apps/cloud/src/project/project.controller.ts
@@ -278,6 +278,14 @@ export class ProjectController {
throw new BadRequestException('The provided project ID is incorrect')
}
+ const project = await this.projectService.getFullProject(projectId, userId)
+
+ if (!project) {
+ throw new NotFoundException('Project not found')
+ }
+
+ this.projectService.allowedToView(project, userId)
+
await this.projectService.unpinProject(userId, projectId)
await trackCustom(ip, headers['user-agent'], {
diff --git a/backend/apps/community/src/project/project.controller.ts b/backend/apps/community/src/project/project.controller.ts
index 45f38302b..0bc143244 100644
--- a/backend/apps/community/src/project/project.controller.ts
+++ b/backend/apps/community/src/project/project.controller.ts
@@ -354,6 +354,14 @@ export class ProjectController {
throw new BadRequestException('The provided project ID is incorrect')
}
+ const project = await this.projectService.getFullProject(projectId)
+
+ if (!project) {
+ throw new NotFoundException('Project not found')
+ }
+
+ this.projectService.allowedToView(project, userId)
+
await unpinProjectClickhouse(userId, projectId)
}