MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / isProfileAllowed

Method isProfileAllowed

src/shared/ProfileValidator.ts:4–24  ·  view source on GitHub ↗
(profile: ProviderSettings, allowList: OrganizationAllowList)

Source from the content-addressed store, hash-verified

2
3export class ProfileValidator {
4 public static isProfileAllowed(profile: ProviderSettings, allowList: OrganizationAllowList): boolean {
5 if (allowList.allowAll) {
6 return true
7 }
8
9 if (!profile.apiProvider) {
10 return false
11 }
12
13 if (!this.isProviderAllowed(profile.apiProvider, allowList)) {
14 return false
15 }
16
17 const modelId = this.getModelIdFromProfile(profile)
18
19 if (!modelId) {
20 return allowList.providers[profile.apiProvider]?.allowAll === true
21 }
22
23 return this.isModelAllowed(profile.apiProvider, modelId, allowList)
24 }
25
26 private static isProviderAllowed(providerName: string, allowList: OrganizationAllowList): boolean {
27 if (allowList.allowAll) {

Callers 3

createTaskMethod · 0.80
ChatViewComponentFunction · 0.80

Calls 3

isProviderAllowedMethod · 0.95
getModelIdFromProfileMethod · 0.95
isModelAllowedMethod · 0.95

Tested by

no test coverage detected