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() {
let last_comp = (pos + 1) == path.len();
node = match node.children.get(*comp) {
Some(n) => n,
None => return role_map, // path not found
};
for scomp in comp.split('/') {
node = match node.children.get(scomp) {
Some(n) => n,
None => return role_map, // path not found
};
let new_map = node.extract_roles(auth_id, last_comp);
if !new_map.is_empty() {
// overwrite previous maptings
role_map = new_map;
let new_map = node.extract_roles(auth_id, last_comp);
if !new_map.is_empty() {
// overwrite previous mappings
role_map = new_map;
}
}
}