[pve-devel] [PATCH manager 6/9] api: replication config: remove dead code

Fiona Ebner f.ebner at proxmox.com
Fri Jul 18 11:30:12 CEST 2025


The RPCEnvironment's check() method is used without $noerr, so it will
already fail and raise the proper permission exception when the
privilege is missing.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/API2/ReplicationConfig.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/ReplicationConfig.pm b/PVE/API2/ReplicationConfig.pm
index 34d519c8..1c6ac765 100644
--- a/PVE/API2/ReplicationConfig.pm
+++ b/PVE/API2/ReplicationConfig.pm
@@ -4,7 +4,7 @@ use warnings;
 use strict;
 
 use PVE::Cluster;
-use PVE::Exception qw(raise_perm_exc raise_param_exc);
+use PVE::Exception qw(raise_param_exc);
 use PVE::JSONSchema qw(get_standard_option);
 use PVE::ReplicationConfig;
 use PVE::RESTHandler;
@@ -90,7 +90,7 @@ __PACKAGE__->register_method({
 
         my $vmid = $data->{guest};
 
-        raise_perm_exc() if !$rpcenv->check($authuser, "/vms/$vmid", ['VM.Audit']);
+        $rpcenv->check($authuser, "/vms/$vmid", ['VM.Audit']);
 
         $data->{id} = $param->{id};
 
-- 
2.47.2





More information about the pve-devel mailing list