File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,14 @@ export async function insertContentTool(
5858 return
5959 }
6060
61+ const accessAllowed = cline . rooIgnoreController ?. validateAccess ( relPath )
62+
63+ if ( ! accessAllowed ) {
64+ await cline . say ( "rooignore_error" , relPath )
65+ pushToolResult ( formatResponse . toolError ( formatResponse . rooIgnoreError ( relPath ) ) )
66+ return
67+ }
68+
6169 const absolutePath = path . resolve ( cline . cwd , relPath )
6270 const fileExists = await fileExistsAtPath ( absolutePath )
6371
Original file line number Diff line number Diff line change @@ -115,6 +115,14 @@ export async function searchAndReplaceTool(
115115 endLine : endLine ,
116116 }
117117
118+ const accessAllowed = cline . rooIgnoreController ?. validateAccess ( validRelPath )
119+
120+ if ( ! accessAllowed ) {
121+ await cline . say ( "rooignore_error" , validRelPath )
122+ pushToolResult ( formatResponse . toolError ( formatResponse . rooIgnoreError ( validRelPath ) ) )
123+ return
124+ }
125+
118126 const absolutePath = path . resolve ( cline . cwd , validRelPath )
119127 const fileExists = await fileExistsAtPath ( absolutePath )
120128
You can’t perform that action at this time.
0 commit comments