Evaluates the request approval summary and returns the evaluation status based on the minimum approvals required. If the request does not yet have enough approvals to meet the minimum approvals required but has enough uncast approvals that could be cast to meet the minimum approvals required, then the evaluation is kept in the `Pending` state.
(&self, min_approved: usize)
| 320 | Context = (Arc<Request>, Arc<RequestPolicyRule>), |
| 321 | Error = EvaluateError, |
| 322 | >: Sync + Send |
| 323 | { |
| 324 | fn evaluate(&self, ctx: Context) -> Result<Status, Error>; |
| 325 | } |
| 326 | |
| 327 | #[derive(Clone)] |
| 328 | pub struct RequestPolicyRuleEvaluator { |
| 329 | pub user_matcher: Arc<dyn Match<UserInvolvedInPolicyRuleForRequestResource>>, |
| 330 | pub address_book_metadata_matcher: Arc<dyn Match<RequestHasMetadata>>, |
| 331 | } |
| 332 | |
| 333 | struct RequestApprovalSummary { |
| 334 | total_possible_approvers: usize, |
| 335 | approvers: Vec<UserId>, |
| 336 | approved: usize, |
| 337 | rejected: usize, |
| 338 | } |
| 339 | |
| 340 | impl RequestApprovalSummary { |
| 341 | /// Evaluates the request approval summary and returns the evaluation status based on the |
no test coverage detected