From 815e1961701e13c933c3975c6026c60d1ded3cdf Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 17 Nov 2025 01:42:43 +0000 Subject: refactor: remove the PrivacyAware interface --- packages/trpc/models/highlights.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'packages/trpc/models/highlights.ts') diff --git a/packages/trpc/models/highlights.ts b/packages/trpc/models/highlights.ts index 260c4b8a..49791467 100644 --- a/packages/trpc/models/highlights.ts +++ b/packages/trpc/models/highlights.ts @@ -12,9 +12,8 @@ import { zCursorV2 } from "@karakeep/shared/types/pagination"; import { AuthedContext } from ".."; import { BareBookmark } from "./bookmarks"; -import { PrivacyAware } from "./privacy"; -export class Highlight implements PrivacyAware { +export class Highlight { constructor( protected ctx: AuthedContext, private highlight: typeof highlights.$inferSelect, @@ -115,15 +114,6 @@ export class Highlight implements PrivacyAware { }; } - ensureCanAccess(ctx: AuthedContext): void { - if (this.highlight.userId !== ctx.user.id) { - throw new TRPCError({ - code: "FORBIDDEN", - message: "User is not allowed to access resource", - }); - } - } - async delete(): Promise> { const result = await this.ctx.db .delete(highlights) -- cgit v1.2.3-70-g09d2