api: tape/restore: check and create target namespace

checks the privilegs for the target namespace. If that does not exist,
try to recursively create them while checking the privileges.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2022-05-06 16:44:16 +02:00
parent 6b61d319c5
commit fc99c2791b
3 changed files with 124 additions and 12 deletions

View File

@ -1244,6 +1244,7 @@ pub fn catalog_media(
let verbose = verbose.unwrap_or(false);
let force = force.unwrap_or(false);
let scan = scan.unwrap_or(false);
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
let upid_str = run_drive_worker(
rpcenv,
@ -1340,6 +1341,7 @@ pub fn catalog_media(
None,
&mut checked_chunks,
verbose,
&auth_id,
)?;
Ok(())