aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/models/highlights.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-11-17 01:42:43 +0000
committerMohamed Bassem <me@mbassem.com>2025-11-17 01:42:43 +0000
commit815e1961701e13c933c3975c6026c60d1ded3cdf (patch)
treeb88921d5cc37720fb3a3c1654417fce3fa0f6f02 /packages/trpc/models/highlights.ts
parent88c73e212c4510ce41ad8c6557fa7d5c8f72d199 (diff)
downloadkarakeep-815e1961701e13c933c3975c6026c60d1ded3cdf.tar.zst
refactor: remove the PrivacyAware interface
Diffstat (limited to 'packages/trpc/models/highlights.ts')
-rw-r--r--packages/trpc/models/highlights.ts12
1 files changed, 1 insertions, 11 deletions
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<z.infer<typeof zHighlightSchema>> {
const result = await this.ctx.db
.delete(highlights)