src/api2/node/status.rs: add access permissions

This commit is contained in:
Dietmar Maurer 2020-04-16 17:05:09 +02:00
parent 9989d2c4e9
commit b5037fa8ed

View File

@ -3,10 +3,11 @@ use serde_json::{json, Value};
use proxmox::sys::linux::procfs; use proxmox::sys::linux::procfs;
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, SubdirMap}; use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, SubdirMap, Permission};
use proxmox::list_subdirs_api_method; use proxmox::list_subdirs_api_method;
use crate::api2::types::*; use crate::api2::types::*;
use crate::config::acl::PRIV_SYS_AUDIT;
#[api( #[api(
input: { input: {
@ -44,7 +45,10 @@ use crate::api2::types::*;
optional: true, optional: true,
}, },
} }
} },
access: {
permission: &Permission::Privilege(&[], PRIV_SYS_AUDIT, false),
},
)] )]
/// Read node memory, CPU and (root) disk usage /// Read node memory, CPU and (root) disk usage
fn get_usage( fn get_usage(