config: acl tree: allow path components to be paths too

will be used for namespaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-05-04 18:11:43 +02:00
parent dc3d716bdb
commit c5648f1920

View File

@ -602,15 +602,17 @@ impl AclTree {
for (pos, comp) in path.iter().enumerate() { for (pos, comp) in path.iter().enumerate() {
let last_comp = (pos + 1) == path.len(); let last_comp = (pos + 1) == path.len();
node = match node.children.get(*comp) { for scomp in comp.split('/') {
Some(n) => n, node = match node.children.get(scomp) {
None => return role_map, // path not found Some(n) => n,
}; None => return role_map, // path not found
};
let new_map = node.extract_roles(auth_id, last_comp); let new_map = node.extract_roles(auth_id, last_comp);
if !new_map.is_empty() { if !new_map.is_empty() {
// overwrite previous maptings // overwrite previous mappings
role_map = new_map; role_map = new_map;
}
} }
} }