Files
Agent-System/internal/server/admin_permissions_handlers.go
T
weichenandCursor 90f77eac93 feat(authz): implement six-phase permissions, settings and workflow v2
Close P0 auth gaps for lineage/runs, stage ABAC fail-closed, and
project:create; add IAM migrations 00021-23, me settings APIs, schema v2
manifests, orchestrator skeleton, and gate A regression coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00

21 lines
539 B
Go

package server
import (
"net/http"
"chat-agent-system/internal/authz"
)
// handleAdminPermissions GET /api/v1/admin/permissions — 权限目录(服务端权威)
func (s *Server) handleAdminPermissions(w http.ResponseWriter, r *http.Request) {
if _, ok := s.requirePrincipal(w, r); !ok {
return
}
if r.Method != http.MethodGet {
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
return
}
catalog := authz.PermissionCatalog()
writeJSONResponse(w, http.StatusOK, map[string]any{"permissions": catalog})
}