()
| 214 | |
| 215 | #[test] |
| 216 | fn test_policy_disabled() { |
| 217 | let mut policy = PermissionPolicy::new().deny("Bash(rm:*)").ask("Bash(*)"); |
| 218 | policy.enabled = false; |
| 219 | |
| 220 | // When disabled, everything is allowed |
| 221 | let decision = policy.check("Bash", &json!({"command": "rm -rf /"})); |
| 222 | assert_eq!(decision, PermissionDecision::Allow); |
| 223 | } |
| 224 | |
| 225 | #[test] |
| 226 | fn test_policy_is_allowed() { |