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>
21 lines
539 B
Go
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})
|
|
}
|