Phase 13, part 1: a Postgres schema per team
On the multi-tenant edition each team's data is in its own schema; the tables every team shares (people, sessions, memberships, keys, locks, and a new teams table) stay in the main one. A team's connection pool searches its own schema first, so the app's SQL runs unchanged and can't reach another team's tables. Each request is served by a copy of the Server for the viewer's team, with that team's database, secrets and caches; agents work on their own team's. The local and server editions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,14 @@ import (
|
||||
|
||||
// AgentTools adds the module tools a caller may use.
|
||||
func (s *Server) AgentTools(srv *mcp.Server, c *mcpserver.Caller) {
|
||||
if c != nil && s.multi() {
|
||||
ts, err := s.forTeam(c.Team)
|
||||
if err != nil {
|
||||
s.Log.Error("mcp: the agent's team", "team", c.Team, "err", err)
|
||||
return
|
||||
}
|
||||
s = ts
|
||||
}
|
||||
may := func(module string, act bool) bool { return c == nil || c.Can(module, act) }
|
||||
if may("content", false) {
|
||||
s.contentReadTools(srv)
|
||||
|
||||
Reference in New Issue
Block a user