feat: encapsulate identity with better-auth
This commit is contained in:
@@ -16,18 +16,18 @@ resourcePolicy:
|
||||
roles: ["super", "admin", "user"]
|
||||
condition:
|
||||
match:
|
||||
expr: R.attr.id in P.attr.workspaceIds
|
||||
expr: R.attr.workspaceId in P.attr.workspaceIds
|
||||
|
||||
- actions: ["update"]
|
||||
effect: EFFECT_ALLOW
|
||||
roles: ["super", "admin"]
|
||||
condition:
|
||||
match:
|
||||
expr: R.attr.id in P.attr.workspaceIds
|
||||
expr: R.attr.workspaceId in P.attr.workspaceIds
|
||||
|
||||
- actions: ["delete"]
|
||||
effect: EFFECT_ALLOW
|
||||
roles: ["super"]
|
||||
condition:
|
||||
match:
|
||||
expr: R.attr.id in P.attr.workspaceIds
|
||||
expr: R.attr.workspaceId in P.attr.workspaceIds
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { container } from "@platform/database/container.ts";
|
||||
import { mongo } from "@platform/database/client.ts";
|
||||
import { EventFactory, EventStore, Prettify, Projector } from "@valkyr/event-store";
|
||||
import { MongoAdapter } from "@valkyr/event-store/mongo";
|
||||
|
||||
@@ -20,7 +20,7 @@ const eventFactory = new EventFactory([
|
||||
*/
|
||||
|
||||
export const eventStore = new EventStore({
|
||||
adapter: new MongoAdapter(() => container.get("mongo"), `workspace:event-store`),
|
||||
adapter: new MongoAdapter(() => mongo, `workspace:event-store`),
|
||||
events: eventFactory,
|
||||
snapshot: "auto",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user