fix #2957: allow Sys.Audit access to node RRD

this is the same privilege needed to query the node status.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2020-09-16 11:51:12 +02:00 committed by Dietmar Maurer
parent a086427a7d
commit 463c03462a
1 changed files with 5 additions and 1 deletions

View File

@ -1,9 +1,10 @@
use anyhow::Error; use anyhow::Error;
use serde_json::{Value, json}; use serde_json::{Value, json};
use proxmox::api::{api, Router}; use proxmox::api::{api, Permission, Router};
use crate::api2::types::*; use crate::api2::types::*;
use crate::config::acl::PRIV_SYS_AUDIT;
use crate::rrd::{extract_cached_data, RRD_DATA_ENTRIES}; use crate::rrd::{extract_cached_data, RRD_DATA_ENTRIES};
pub fn create_value_from_rrd( pub fn create_value_from_rrd(
@ -56,6 +57,9 @@ pub fn create_value_from_rrd(
}, },
}, },
}, },
access: {
permission: &Permission::Privilege(&["system", "status"], PRIV_SYS_AUDIT, false),
},
)] )]
/// Read node stats /// Read node stats
fn get_node_stats( fn get_node_stats(