]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/api2/pull.rs: add access permission
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 17 Apr 2020 13:27:04 +0000 (15:27 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 17 Apr 2020 13:27:04 +0000 (15:27 +0200)
src/api2/pull.rs

index 5cfa1f2a2b8dc24c6052b3f9e3c2cabe30eaf8a4..e1a5a27659d49531ed66e048142d5b870536bb02 100644 (file)
@@ -9,13 +9,14 @@ use std::io::{Seek, SeekFrom};
 use chrono::{Utc, TimeZone};
 
 use proxmox::api::api;
-use proxmox::api::{ApiMethod, Router, RpcEnvironment};
+use proxmox::api::{ApiMethod, Router, RpcEnvironment, Permission};
 
 use crate::server::{WorkerTask};
 use crate::backup::*;
 use crate::client::*;
 use crate::config::remote;
 use crate::api2::types::*;
+use crate::config::acl::PRIV_DATASTORE_ALLOCATE_SPACE;
 
 // fixme: implement filters
 // fixme: delete vanished groups
@@ -387,6 +388,12 @@ pub async fn pull_store(
             },
         },
     },
+    access: {
+        permission: &Permission::And(&[
+            &Permission::Privilege(&["datastore", "{store}"], PRIV_DATASTORE_ALLOCATE_SPACE, false),
+            &Permission::Privilege(&["remote", "{store}"], PRIV_DATASTORE_ALLOCATE_SPACE, false),
+        ]),
+    },
 )]
 /// Sync store from other repository
 async fn pull (