MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveEffectivePolicy

Function resolveEffectivePolicy

packages/core/sdk/src/policies.ts:247–255  ·  view source on GitHub ↗
(
  toolId: string,
  policies: readonly ToolPolicyRow[],
  ownerRank: (row: Pick<ToolPolicyRow, "owner">) => number,
  defaultRequiresApproval?: boolean,
)

Source from the content-addressed store, hash-verified

245});
246
247export const resolveEffectivePolicy = (
248 toolId: string,
249 policies: readonly ToolPolicyRow[],
250 ownerRank: (row: Pick<ToolPolicyRow, "owner">) => number,
251 defaultRequiresApproval?: boolean,
252): EffectivePolicy => {
253 const match = resolveToolPolicy(toolId, policies, ownerRank);
254 return match ? liftUser(match) : liftPlugin(defaultRequiresApproval);
255};
256
257export const effectivePolicyFromSorted = (
258 toolId: string,

Callers 2

resolvePolicyFromRuleSetFunction · 0.90
policiesResolveFunction · 0.90

Calls 3

resolveToolPolicyFunction · 0.85
liftUserFunction · 0.85
liftPluginFunction · 0.85

Tested by

no test coverage detected