From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 05AD41FF0A5 for ; Fri, 04 Sep 2026 11:45:06 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2CC5021594; Fri, 04 Sep 2026 11:45:03 +0200 (CEST) From: Elias Huhsovitz To: pve-devel@lists.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 Message-ID: <20260904094456.70309-3-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260904094456.70309-1-e.huhsovitz@proxmox.com> References: <20260904094456.70309-1-e.huhsovitz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788515095616 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.670 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZBJEPOP2YJCVQQNRFP5FDRWNIRGLNTJ6 X-Message-ID-Hash: ZBJEPOP2YJCVQQNRFP5FDRWNIRGLNTJ6 X-MailFrom: e.huhsovitz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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