* [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint
@ 2026-08-27 13:00 Shan Shaji
2026-08-28 9:56 ` Thomas Ellmenreich
2026-08-28 10:59 ` applied: " Lukas Wagner
0 siblings, 2 replies; 3+ messages in thread
From: Shan Shaji @ 2026-08-27 13:00 UTC (permalink / raw)
To: pdm-devel
The /rrddata endpoint did not have the access parameter defined inside
the API macro. This resulted in a "403: permission check failed" error
in the UI even though the user was assigned the Administrator role on
the / ACL path. This issue was raised in the forum [0].
Fix this by adding the explicit permission check.
- [0] https://forum.proxmox.com/threads/185992/
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
server/src/api/nodes/rrddata.rs | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/server/src/api/nodes/rrddata.rs b/server/src/api/nodes/rrddata.rs
index b6e55b48..0bb8b374 100644
--- a/server/src/api/nodes/rrddata.rs
+++ b/server/src/api/nodes/rrddata.rs
@@ -1,11 +1,11 @@
use anyhow::Error;
use proxmox_rrd_api_types::{RrdMode, RrdTimeframe};
-use proxmox_router::{Router, http_bail};
+use proxmox_router::{Permission, Router, http_bail};
use proxmox_schema::api;
-use pdm_api_types::NODE_SCHEMA;
use pdm_api_types::rrddata::PdmNodeDatapoint;
+use pdm_api_types::{NODE_SCHEMA, PRIV_SYS_AUDIT};
use crate::api::rrd_common::{self, DataPoint};
@@ -97,7 +97,11 @@ impl DataPoint for PdmNodeDatapoint {
items: {
type: PdmNodeDatapoint,
}
- }
+ },
+ access: {
+ permission: &Permission::Privilege(&["system", "status"], PRIV_SYS_AUDIT, false),
+ description: "Requires `Sys.Audit` privilege on `/system/status`."
+ },
)]
/// Read RRD data for this PDM node.
fn get_node_rrddata(
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint
2026-08-27 13:00 [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint Shan Shaji
@ 2026-08-28 9:56 ` Thomas Ellmenreich
2026-08-28 10:59 ` applied: " Lukas Wagner
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Ellmenreich @ 2026-08-28 9:56 UTC (permalink / raw)
To: Shan Shaji, pdm-devel
I tested it before and after, and it works as expected.
Since the commit message didn't make it clear which exact rrddata path it is,
I tried a few others and noticed that this one also returns 'permission
check failed':
`/api2/json/remotes/remote/cluster1/rrddata`
In any case:
Reviewed-by: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Tested-by Thomas Ellmenreich <t.ellmenreich@proxmox.com>
On Thu Aug 27, 2026 at 3:00 PM CEST, Shan Shaji wrote:
> The /rrddata endpoint did not have the access parameter defined inside
> the API macro. This resulted in a "403: permission check failed" error
> in the UI even though the user was assigned the Administrator role on
> the / ACL path. This issue was raised in the forum [0].
>
> Fix this by adding the explicit permission check.
>
> - [0] https://forum.proxmox.com/threads/185992/
>
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
> server/src/api/nodes/rrddata.rs | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/server/src/api/nodes/rrddata.rs b/server/src/api/nodes/rrddata.rs
> index b6e55b48..0bb8b374 100644
> --- a/server/src/api/nodes/rrddata.rs
> +++ b/server/src/api/nodes/rrddata.rs
> @@ -1,11 +1,11 @@
> use anyhow::Error;
> use proxmox_rrd_api_types::{RrdMode, RrdTimeframe};
>
> -use proxmox_router::{Router, http_bail};
> +use proxmox_router::{Permission, Router, http_bail};
> use proxmox_schema::api;
>
> -use pdm_api_types::NODE_SCHEMA;
> use pdm_api_types::rrddata::PdmNodeDatapoint;
> +use pdm_api_types::{NODE_SCHEMA, PRIV_SYS_AUDIT};
>
> use crate::api::rrd_common::{self, DataPoint};
>
> @@ -97,7 +97,11 @@ impl DataPoint for PdmNodeDatapoint {
> items: {
> type: PdmNodeDatapoint,
> }
> - }
> + },
> + access: {
> + permission: &Permission::Privilege(&["system", "status"], PRIV_SYS_AUDIT, false),
> + description: "Requires `Sys.Audit` privilege on `/system/status`."
> + },
> )]
> /// Read RRD data for this PDM node.
> fn get_node_rrddata(
^ permalink raw reply [flat|nested] 3+ messages in thread* applied: [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint
2026-08-27 13:00 [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint Shan Shaji
2026-08-28 9:56 ` Thomas Ellmenreich
@ 2026-08-28 10:59 ` Lukas Wagner
1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2026-08-28 10:59 UTC (permalink / raw)
To: pdm-devel, Shan Shaji
On Thu, 27 Aug 2026 15:00:33 +0200, Shan Shaji wrote:
> The /rrddata endpoint did not have the access parameter defined inside
> the API macro. This resulted in a "403: permission check failed" error
> in the UI even though the user was assigned the Administrator role on
> the / ACL path. This issue was raised in the forum [0].
>
> Fix this by adding the explicit permission check.
>
> [...]
Applied, with Thomas' R-b and T-b trailers added, thanks!
[1/1] api: nodes: add explicit permission check for RRD data points endpoint
commit: 14724450e0a8bf4841bbcd7843b903a0a923e4aa
Best regards,
--
Lukas Wagner <l.wagner@proxmox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-28 11:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 13:00 [PATCH datacenter-manager] api: nodes: add explicit permission check for RRD data points endpoint Shan Shaji
2026-08-28 9:56 ` Thomas Ellmenreich
2026-08-28 10:59 ` applied: " Lukas Wagner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.