diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index a5704c93..c9aa6b74 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -722,9 +722,7 @@ impl BackupNamespace { Ok(()) } - pub fn acl_path<'a>(&'a self, store: &'a str) -> Vec<&'a str> { - let mut path: Vec<&str> = vec!["datastore", store]; - + fn acl_path_extend<'a>(&'a self, mut path: Vec<&'a str>) -> Vec<&'a str> { if self.is_root() { path } else { @@ -733,6 +731,14 @@ impl BackupNamespace { } } + pub fn acl_path<'a>(&'a self, store: &'a str) -> Vec<&'a str> { + self.acl_path_extend(vec!["datastore", store]) + } + + pub fn remote_acl_path<'a>(&'a self, remote: &'a str, store: &'a str) -> Vec<&'a str> { + self.acl_path_extend(vec!["remote", remote, store]) + } + /// Check whether this namespace contains another namespace. /// /// If so, the depth is returned.