()
| 364 | |
| 365 | #[test] |
| 366 | fn test_manager_remove_session_policy() { |
| 367 | let mut manager = PermissionManager::new(); |
| 368 | |
| 369 | let session_policy = PermissionPolicy { |
| 370 | default_decision: PermissionDecision::Allow, |
| 371 | ..PermissionPolicy::default() |
| 372 | }; |
| 373 | manager.set_session_policy("session-1", session_policy); |
| 374 | |
| 375 | // Before removal |
| 376 | let decision = manager.check("session-1", "Bash", &json!({"command": "anything"})); |
| 377 | assert_eq!(decision, PermissionDecision::Allow); |
| 378 | |
| 379 | manager.remove_session_policy("session-1"); |
| 380 | |
| 381 | // After removal - falls back to global |
| 382 | let decision = manager.check("session-1", "Bash", &json!({"command": "anything"})); |
| 383 | assert_eq!(decision, PermissionDecision::Ask); |
| 384 | } |
| 385 | |
| 386 | #[test] |
| 387 | fn test_manager_global_deny_overrides_session_allow() { |
nothing calls this directly
no test coverage detected