(block)
| 182 | |
| 183 | # Pipeline: all three gates chained |
| 184 | def 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 | # ═══════════════════════════════════════════════════════════ |
no test coverage detected