MCPcopy Create free account
hub / github.com/codeaashu/claude-code / handleUserAllow

Function handleUserAllow

src/hooks/toolPermission/PermissionContext.ts:291–318  ·  view source on GitHub ↗
(
      updatedInput: Record<string, unknown>,
      permissionUpdates: PermissionUpdate[],
      feedback?: string,
      permissionPromptStartTimeMs?: number,
      contentBlocks?: ContentBlockParam[],
      decisionReason?: PermissionDecisionReason,
    )

Source from the content-addressed store, hash-verified

289 return { behavior: 'deny' as const, message, decisionReason }
290 },
291 async handleUserAllow(
292 updatedInput: Record<string, unknown>,
293 permissionUpdates: PermissionUpdate[],
294 feedback?: string,
295 permissionPromptStartTimeMs?: number,
296 contentBlocks?: ContentBlockParam[],
297 decisionReason?: PermissionDecisionReason,
298 ): Promise<PermissionAllowDecision> {
299 const acceptedPermanentUpdates =
300 await this.persistPermissions(permissionUpdates)
301 this.logDecision(
302 {
303 decision: 'accept',
304 source: { type: 'user', permanent: acceptedPermanentUpdates },
305 },
306 { input: updatedInput, permissionPromptStartTimeMs },
307 )
308 const userModified = tool.inputsEquivalent
309 ? !tool.inputsEquivalent(input, updatedInput)
310 : false
311 const trimmedFeedback = feedback?.trim()
312 return this.buildAllow(updatedInput, {
313 userModified,
314 decisionReason,
315 acceptFeedback: trimmedFeedback || undefined,
316 contentBlocks,
317 })
318 },
319 async handleHookAllow(
320 finalInput: Record<string, unknown>,
321 permissionUpdates: PermissionUpdate[],

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected