MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_permission_manager_check_allow

Function test_permission_manager_check_allow

core/src/permissions/tests.rs:577–583  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

575
576#[test]
577fn test_permission_manager_check_allow() {
578 let mut pm = PermissionManager::new();
579 pm.set_global_policy(PermissionPolicy::new().allow("Bash(cargo:*)"));
580
581 let decision = pm.check("s1", "Bash", &json!({"command": "cargo build"}));
582 assert_eq!(decision, PermissionDecision::Allow);
583}
584
585#[test]
586fn test_permission_manager_check_session_override() {

Callers

nothing calls this directly

Calls 3

set_global_policyMethod · 0.80
allowMethod · 0.80
checkMethod · 0.45

Tested by

no test coverage detected