MCPcopy Create free account
hub / github.com/coder/coder / isTemplateAllowed

Function isTemplateAllowed

coderd/x/chatd/chattool/chattool.go:172–181  ·  view source on GitHub ↗

isTemplateAllowed checks whether a template ID is permitted by the configured allowlist. A nil function or an empty allowlist means all templates are allowed.

(getAllowlist func() map[uuid.UUID]bool, id uuid.UUID)

Source from the content-addressed store, hash-verified

170// configured allowlist. A nil function or an empty allowlist means
171// all templates are allowed.
172func isTemplateAllowed(getAllowlist func() map[uuid.UUID]bool, id uuid.UUID) bool {
173 if getAllowlist == nil {
174 return true
175 }
176 allowlist := getAllowlist()
177 if len(allowlist) == 0 {
178 return true
179 }
180 return allowlist[id]
181}

Callers 2

CreateWorkspaceFunction · 0.85
ReadTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected