mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 08:15:29 +00:00
Reject cross-tenant skill grant and revoke operations before grant rows or skill visibility can be changed. Clean legacy invalid grant rows in PostgreSQL and SQLite migrations, hide owner IDs from skill API/UI responses, and cover the tenant-isolation cases with PG and SQLite regression tests.
9 lines
220 B
SQL
9 lines
220 B
SQL
DELETE FROM skill_agent_grants sag
|
|
USING skills s, agents a
|
|
WHERE sag.skill_id = s.id
|
|
AND sag.agent_id = a.id
|
|
AND (
|
|
sag.tenant_id <> a.tenant_id
|
|
OR (s.is_system = false AND sag.tenant_id <> s.tenant_id)
|
|
);
|