fix(webui): keep the instance settings out of another org's reach
This commit is contained in:
1 parent
5b3b88ed3d
commit
58629ea03a
5 files changed
+36
-14
No files matched your search
@@ -2,9 +2,9 @@ package webui
|
||||
|
||||
import "net/http"
|
||||
|
||||
// handleCapabilities reports which dashboard sections this process can serve,
|
||||
// so the browser hides the rest.
|
||||
func (s *Server) handleCapabilities(w http.ResponseWriter, _ *http.Request) {
|
||||
// handleCapabilities reports which dashboard sections this process can serve
|
||||
// and which the caller may use, so the browser hides the rest.
|
||||
func (s *Server) handleCapabilities(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, map[string]any{
|
||||
"sections": map[string]bool{
|
||||
"chat": s.Chat != nil && s.Chat.Contract != nil,
|
||||
@@ -19,8 +19,10 @@ func (s *Server) handleCapabilities(w http.ResponseWriter, _ *http.Request) {
|
||||
// and its definition list from the local registry, so it is
|
||||
// worth showing with only the former.
|
||||
"workflows": true,
|
||||
// Configuration renders from whichever source is wired.
|
||||
"settings": true,
|
||||
// Configuration renders from whichever source is wired, and only
|
||||
// the system org operates the instance: every other org's
|
||||
// settings pages would offer saves the control plane refuses.
|
||||
"settings": instanceViewer(r),
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user