+3
-3
frontend/src/routes/slice-middleware.ts
+3
-3
frontend/src/routes/slice-middleware.ts
···
1
-
import { publicClient } from "../config.ts";
1
+
import { publicClient, ADMIN_DID } from "../config.ts";
2
2
import { buildAtUri } from "../utils/at-uri.ts";
3
3
import { getSlice } from "../lib/api.ts";
4
4
import type { AuthenticatedUser } from "./middleware.ts";
···
79
79
try {
80
80
const slice = await getSlice(publicClient, sliceUri);
81
81
82
-
// User has access if they own the slice
82
+
// User has access if they own the slice or are an admin
83
83
const hasAccess = context.currentUser.isAuthenticated &&
84
-
context.currentUser.sub === profileDid;
84
+
(context.currentUser.sub === profileDid || context.currentUser.sub === ADMIN_DID);
85
85
86
86
return {
87
87
...context,