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

Function and_combination

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

Source from the content-addressed store, hash-verified

288
289 #[test]
290 fn and_combination() {
291 let pred = RlsPredicate::And(vec![
292 RlsPredicate::Compare {
293 field: "tenant_id".into(),
294 op: CompareOp::Eq,
295 value: PredicateValue::AuthRef("tenant_id".into()),
296 },
297 RlsPredicate::Compare {
298 field: "status".into(),
299 op: CompareOp::Eq,
300 value: PredicateValue::Literal(serde_json::json!("published")),
301 },
302 ]);
303 let auth = make_auth();
304 let filters = substitute_to_scan_filters(&pred, &auth).unwrap();
305 assert_eq!(filters.len(), 2);
306 }
307
308 #[test]
309 fn or_combination() {

Callers

nothing calls this directly

Calls 2

make_authFunction · 0.70

Tested by

no test coverage detected