(agent: &AgentInfo, tool_name: &str)
| 109 | |
| 110 | impl PermissionNext { |
| 111 | pub fn evaluate(agent: &AgentInfo, tool_name: &str) -> PermissionDecision { |
| 112 | if !agent.allowed_tools.is_empty() |
| 113 | && !agent.allowed_tools.iter().any(|tool| tool == tool_name) |
| 114 | { |
| 115 | return PermissionDecision::Deny; |
| 116 | } |
| 117 | |
| 118 | let permission = tool_to_permission(tool_name); |
| 119 | let rule = evaluate_permission(permission, "*", &[agent.permission.clone()]); |
| 120 | match rule.action { |
| 121 | PermissionAction::Allow => PermissionDecision::Allow, |
| 122 | PermissionAction::Ask => PermissionDecision::Ask, |
| 123 | PermissionAction::Deny => PermissionDecision::Deny, |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | #[derive(Debug, Clone, Serialize, Deserialize)] |
nothing calls this directly
no test coverage detected