mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix(database): restrict db delete to agent-owning org (system agents admin-only)
- UI: delete button gated by canDeleteDatabases prop threaded from each page (org page: only org-created agents; admin page: system agents) - authz: org path requires agent.organizationId === active org; drop join-based attribution so a system agent merely linked to an org is admin-delete-only
This commit is contained in:
@@ -81,7 +81,7 @@ export default async function RoutePage(
|
||||
</PageDescription>
|
||||
)}
|
||||
<PageContent className="flex flex-col w-full h-full justify-between gap-6">
|
||||
<AgentContentPage agent={agent} edgeKey={edgeKey} />
|
||||
<AgentContentPage agent={agent} edgeKey={edgeKey} canDeleteDatabases={true} />
|
||||
</PageContent>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -94,7 +94,7 @@ export default async function RoutePage(
|
||||
</PageDescription>
|
||||
)}
|
||||
<PageContent className="flex flex-col w-full h-full justify-between gap-6">
|
||||
<AgentContentPage agent={agent} edgeKey={edgeKey}/>
|
||||
<AgentContentPage agent={agent} edgeKey={edgeKey} canDeleteDatabases={!!agent.organizationId}/>
|
||||
</PageContent>
|
||||
</Page>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user