fix(dashboard): scope areas and responsibilities to each user (#22513)

This commit is contained in:
scotttong authored and GitHub committed 2026-11-21 13:59:00 -08:00
1 parent 558dbb0132
commit 856f14e507
68 files changed
+2708 -559

No files matched your search

@@ -97,7 +97,7 @@ export function responsibilityAgentChangeService(db: Db) {
agentId: string;
interactionId: string | undefined;
key: string;
ownerUserId?: string;
ownerUserId: string;
}) {
const refuse = () => forbidden(
"A permanent delete needs the person's confirmation: post a confirmation card, then delete with its id after they accept it",
@@ -129,8 +129,7 @@ export function responsibilityAgentChangeService(db: Db) {
eq(companyMemberships.principalId, resolverUserId),
eq(companyMemberships.status, "active"),
));
const allowed = membership && (!input.ownerUserId || resolverUserId === input.ownerUserId
|| membership.role === "owner" || membership.role === "admin");
const allowed = membership && resolverUserId === input.ownerUserId;
if (!allowed) throw refuse();
return card;
},