( rules: ToolkitRuleSnapshot, isOrg: boolean, )
| 205 | // user-only prefixes drop out; the per-tool check still enforces the same |
| 206 | // rule for anything the prefix cannot express. |
| 207 | const toolkitDynamicScope = ( |
| 208 | rules: ToolkitRuleSnapshot, |
| 209 | isOrg: boolean, |
| 210 | ): readonly DynamicToolScope[] => { |
| 211 | const scopes: DynamicToolScope[] = []; |
| 212 | for (const pattern of rules.accessPatterns) { |
| 213 | const scope = dynamicToolScopeForPattern(pattern); |
| 214 | if (!scope) continue; |
| 215 | if (!isOrg) { |
| 216 | scopes.push(scope); |
| 217 | continue; |
| 218 | } |
| 219 | if (scope.owner === "user") continue; |
| 220 | scopes.push(scope.owner === null ? { ...scope, owner: "org" } : scope); |
| 221 | } |
| 222 | return scopes; |
| 223 | }; |
| 224 | |
| 225 | const legacyConnectionPolicyIds = ( |
| 226 | policies: readonly ToolkitPolicyRecord[], |
no test coverage detected