]> git.proxmox.com Git - proxmox-backup.git/commitdiff
privs: use Datastore.Modify|Backup to set backup notes
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 30 Oct 2020 11:36:38 +0000 (12:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 30 Oct 2020 15:36:52 +0000 (16:36 +0100)
Datastore.Backup is limited to owned groups, as usual.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/api2/admin/datastore.rs

index 41e270a10435524520099f5ec7e8af06a7bdbea9..b9412ba67e5884dbbb49cd36c5e76215a3315cc9 100644 (file)
@@ -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();