casbin::function_map

Function key_match4

Source
pub fn key_match4(key1: &str, key2: &str) -> bool
Expand description

KeyMatch4 determines whether key1 matches the pattern of key2 (similar to RESTful path), key2 can contain a *.
Besides what KeyMatch3 does, KeyMatch4 can also match repeated patterns:

  • “/parent/123/child/123” matches “/parent/{id}/child/{id}”
  • “/parent/123/child/456” does not match “/parent/{id}/child/{id}”

But KeyMatch3 will match both.