mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-18 02:47:48 +00:00
api types: implement remote acl path method for sync job
Add `remote_acl_path` method which generates the acl path from the sync job configuration. This helper allows to easily generate the acl path from a given sync job config for privilege checks. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
48809ab0db
commit
8614be4ceb
@ -594,6 +594,14 @@ impl SyncJobConfig {
|
||||
None => vec!["datastore", &self.store],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remote_acl_path(&self) -> Option<Vec<&str>> {
|
||||
let remote = self.remote.as_ref()?;
|
||||
match &self.remote_ns {
|
||||
Some(remote_ns) => Some(remote_ns.remote_acl_path(remote, &self.remote_store)),
|
||||
None => Some(vec!["remote", remote, &self.remote_store]),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[api(
|
||||
|
Loading…
Reference in New Issue
Block a user