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 <[email protected]>
---
 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




Reply via email to