MCPcopy Index your code
hub / github.com/shareAI-lab/learn-claude-code / check_rules

Function check_rules

s03_permission/code.py:168–172  ·  view source on GitHub ↗
(tool_name: str, args: dict)

Source from the content-addressed store, hash-verified

166]
167
168def check_rules(tool_name: str, args: dict) -> str | None:
169 for rule in PERMISSION_RULES:
170 if tool_name in rule["tools"] and rule["check"](args):
171 return rule["message"]
172 return None
173
174
175# Gate 3: User approval — wait for confirmation after rule match

Callers 1

check_permissionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected