src/config/acl.rs: rtename PRTIV_DATASTORE_ALLOCATE to PRIV_DATASTORE_MODIFY

This commit is contained in:
Dietmar Maurer 2020-04-27 06:50:35 +02:00
parent 14627d671a
commit 9c7fe29dfc
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
use crate::api2::types::*;
use crate::backup::*;
use crate::config::datastore;
use crate::config::acl::{PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_ALLOCATE};
use crate::config::acl::{PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_MODIFY};
#[api(
input: {
@ -66,7 +66,7 @@ pub fn list_datastores(
},
},
access: {
permission: &Permission::Privilege(&["datastore"], PRIV_DATASTORE_ALLOCATE, false),
permission: &Permission::Privilege(&["datastore"], PRIV_DATASTORE_MODIFY, false),
},
)]
/// Create new datastore config.
@ -137,7 +137,7 @@ pub fn read_datastore(name: String) -> Result<Value, Error> {
},
},
access: {
permission: &Permission::Privilege(&["datastore", "{name}"], PRIV_DATASTORE_ALLOCATE, false),
permission: &Permission::Privilege(&["datastore", "{name}"], PRIV_DATASTORE_MODIFY, false),
},
)]
/// Update datastore config.
@ -189,7 +189,7 @@ pub fn update_datastore(
},
},
access: {
permission: &Permission::Privilege(&["datastore", "{name}"], PRIV_DATASTORE_ALLOCATE, false),
permission: &Permission::Privilege(&["datastore", "{name}"], PRIV_DATASTORE_MODIFY, false),
},
)]
/// Remove a datastore configuration.

View File

@ -16,7 +16,7 @@ pub const PRIV_SYS_MODIFY: u64 = 1 << 1;
pub const PRIV_SYS_POWER_MANAGEMENT: u64 = 1 << 2;
pub const PRIV_DATASTORE_AUDIT: u64 = 1 << 3;
pub const PRIV_DATASTORE_ALLOCATE: u64 = 1 << 4;
pub const PRIV_DATASTORE_MODIFY: u64 = 1 << 4;
pub const PRIV_DATASTORE_ALLOCATE_SPACE: u64 = 1 << 5;
pub const PRIV_PERMISSIONS_MODIFY: u64 = 1 << 6;
@ -30,7 +30,7 @@ PRIV_DATASTORE_AUDIT;
pub const ROLE_DATASTORE_ADMIN: u64 =
PRIV_DATASTORE_AUDIT |
PRIV_DATASTORE_ALLOCATE |
PRIV_DATASTORE_MODIFY |
PRIV_DATASTORE_ALLOCATE_SPACE;
pub const ROLE_DATASTORE_USER: u64 =