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

Function check_permission

s03_permission/code.py:184–195  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

182
183# Pipeline: all three gates chained
184def check_permission(block) -> bool:
185 if block.name == "bash":
186 reason = check_deny_list(block.input.get("command", ""))
187 if reason:
188 print(f"\n\033[31m⛔ {reason}\033[0m")
189 return False
190 reason = check_rules(block.name, block.input)
191 if reason:
192 decision = ask_user(block.name, block.input, reason)
193 if decision == "deny":
194 return False
195 return True
196
197
198# ═══════════════════════════════════════════════════════════

Callers 1

agent_loopFunction · 0.85

Calls 4

check_deny_listFunction · 0.85
check_rulesFunction · 0.85
ask_userFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected