MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / or_combination

Function or_combination

nodedb/src/control/security/predicate.rs:309–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

307
308 #[test]
309 fn or_combination() {
310 let pred = RlsPredicate::Or(vec![
311 RlsPredicate::Compare {
312 field: "owner".into(),
313 op: CompareOp::Eq,
314 value: PredicateValue::AuthRef("id".into()),
315 },
316 RlsPredicate::Compare {
317 field: "visibility".into(),
318 op: CompareOp::Eq,
319 value: PredicateValue::Literal(serde_json::json!("public")),
320 },
321 ]);
322 let auth = make_auth();
323 let filters = substitute_to_scan_filters(&pred, &auth).unwrap();
324 assert_eq!(filters.len(), 1);
325 assert_eq!(filters[0].op, crate::bridge::scan_filter::FilterOp::Or);
326 assert_eq!(filters[0].clauses.len(), 2);
327 }
328
329 #[test]
330 fn missing_auth_ref_denies() {

Callers

nothing calls this directly

Calls 2

make_authFunction · 0.70

Tested by

no test coverage detected