api2/access/acl: add path and exact parameter to list_acl

so that we can get only a subset of the acls, filtered by the backed
also return the digest here

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-05-20 12:15:35 +02:00
committed by Dietmar Maurer
parent c0ac207453
commit 2882c881e9
2 changed files with 32 additions and 4 deletions

View File

@ -340,6 +340,11 @@ impl AclTree {
Self { root: AclTreeNode::new() }
}
pub fn find_node(&mut self, path: &str) -> Option<&mut AclTreeNode> {
let path = split_acl_path(path);
return self.get_node(&path);
}
fn get_node(&mut self, path: &[&str]) -> Option<&mut AclTreeNode> {
let mut node = &mut self.root;
for comp in path {