From b728a69e7df309eb598ad7d6c522247b92e07d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 30 Oct 2020 12:36:38 +0100 Subject: [PATCH] privs: use Datastore.Modify|Backup to set backup notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Datastore.Backup is limited to owned groups, as usual. Signed-off-by: Fabian Grünbichler --- src/api2/admin/datastore.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs index 41e270a1..b9412ba6 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -1610,7 +1610,9 @@ fn get_notes( }, }, access: { - permission: &Permission::Privilege(&["datastore", "{store}"], PRIV_DATASTORE_MODIFY, true), + permission: &Permission::Privilege(&["datastore", "{store}"], + PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_BACKUP, + true), }, )] /// Set "notes" for a specific backup @@ -1627,7 +1629,7 @@ fn set_notes( let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?; let backup_dir = BackupDir::new(backup_type, backup_id, backup_time)?; - check_priv_or_backup_owner(&datastore, backup_dir.group(), &auth_id, PRIV_DATASTORE_READ)?; + check_priv_or_backup_owner(&datastore, backup_dir.group(), &auth_id, PRIV_DATASTORE_MODIFY)?; datastore.update_manifest(&backup_dir,|manifest| { manifest.unprotected["notes"] = notes.into();