From: Elias Huhsovitz <e.huhsovitz@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Elias Huhsovitz <e.huhsovitz@proxmox.com>
Subject: [PATCH manager v4 2/2] api: pci: utilize constant perm variable for pci_scan
Date: Fri, 4 Sep 2026 11:44:54 +0200 [thread overview]
Message-ID: <20260904094456.70309-3-e.huhsovitz@proxmox.com> (raw)
In-Reply-To: <20260904094456.70309-1-e.huhsovitz@proxmox.com>
The previous commit factored out the global permission list, i.e.,
['Sys.Audit', 'Sys.Modify']. The `pci_scan` endpoint also utilizes the
same global permissions.
Replace the hard-coded permission check in the `pci_scan` endpoint with
the new GLOBAL_PERMS constant.
Add brief permission description.
Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
PVE/API2/Hardware/PCI.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PVE/API2/Hardware/PCI.pm b/PVE/API2/Hardware/PCI.pm
index eb83824f..83fafcb8 100644
--- a/PVE/API2/Hardware/PCI.pm
+++ b/PVE/API2/Hardware/PCI.pm
@@ -24,7 +24,8 @@ __PACKAGE__->register_method({
protected => 1,
proxyto => "node",
permissions => {
- check => ['perm', '/', ['Sys.Audit', 'Sys.Modify'], any => 1],
+ description => "Requires 'Sys.Audit' or 'Sys.Modify' on '/'.",
+ check => ['perm', '/', GLOBAL_PERMS, any => 1],
},
parameters => {
additionalProperties => 0,
--
2.47.3
prev parent reply other threads:[~2026-09-04 9:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 9:44 [PATCH manager v4 0/2] fix #6735: api: pci: allow mdevscan access via mapping permissions Elias Huhsovitz
2026-09-04 9:44 ` [PATCH manager v4 1/2] " Elias Huhsovitz
2026-09-04 9:44 ` Elias Huhsovitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260904094456.70309-3-e.huhsovitz@proxmox.com \
--to=e.huhsovitz@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox