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)
| 170 | // configured allowlist. A nil function or an empty allowlist means |
| 171 | // all templates are allowed. |
| 172 | func 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 | } |
no outgoing calls
no test coverage detected