MCPcopy Index your code
hub / github.com/larksuite/cli / LoadPlatformAutoApproveSet

Function LoadPlatformAutoApproveSet

internal/registry/loader.go:266–283  ·  view source on GitHub ↗

LoadPlatformAutoApproveSet returns scopes with AutoApprove rule on the platform (from scope_priorities.json only, before overrides).

()

Source from the content-addressed store, hash-verified

264// LoadPlatformAutoApproveSet returns scopes with AutoApprove rule on the platform
265// (from scope_priorities.json only, before overrides).
266func LoadPlatformAutoApproveSet() map[string]bool {
267 if cachedPlatformAutoApprove != nil {
268 return cachedPlatformAutoApprove
269 }
270 m := make(map[string]bool)
271 if data, err := registryFS.ReadFile("scope_priorities.json"); err == nil {
272 var entries []scopePriorityEntry
273 if json.Unmarshal(data, &entries) == nil {
274 for _, entry := range entries {
275 if entry.Recommend == "true" {
276 m[entry.ScopeName] = true
277 }
278 }
279 }
280 }
281 cachedPlatformAutoApprove = m
282 return cachedPlatformAutoApprove
283}
284
285// LoadOverrideAutoApproveAllow returns scopes explicitly listed in
286// scope_overrides.json recommend.allow (our desired additions).

Callers 1

Calls 1

ReadFileMethod · 0.65

Tested by 1