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.eb...@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 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel