Compare commits

...

1 Commits

Author SHA1 Message Date
Jiang Bohan
0a5ee5e48e fix(server): allow members to create agents
Remove the owner/admin role restriction on the POST /api/agents endpoint
so that workspace members can also create agents.
2026-04-14 22:49:50 +08:00

View File

@@ -263,7 +263,7 @@ func NewRouter(pool *pgxpool.Pool, hub *realtime.Hub, bus *events.Bus) chi.Route
// Agents
r.Route("/api/agents", func(r chi.Router) {
r.Get("/", h.ListAgents)
r.With(middleware.RequireWorkspaceRole(queries, "owner", "admin")).Post("/", h.CreateAgent)
r.Post("/", h.CreateAgent)
r.Route("/{id}", func(r chi.Router) {
r.Get("/", h.GetAgent)
r.Put("/", h.UpdateAgent)