public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 6/9] api: replication config: remove dead code
Date: Fri, 18 Jul 2025 11:30:12 +0200	[thread overview]
Message-ID: <20250718093024.55570-7-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250718093024.55570-1-f.ebner@proxmox.com>

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@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


  parent reply	other threads:[~2025-07-18  9:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18  9:30 [pve-devel] [PATCH access-control/manager/docs 0/9] close #2809: replication: add dedicated VM.Replicate privilege Fiona Ebner
2025-07-18  9:30 ` [pve-devel] [PATCH access-control 1/9] add " Fiona Ebner
2025-07-18  9:30 ` [pve-devel] [PATCH manager 2/9] api: replication: code style: order module imports Fiona Ebner
2025-07-18  9:30 ` [pve-devel] [PATCH manager 3/9] api: replication: add missing " Fiona Ebner
2025-07-18  9:30 ` [pve-devel] [PATCH manager 4/9] api: replication config: code style: order " Fiona Ebner
2025-07-18  9:30 ` [pve-devel] [PATCH manager 5/9] api: replication config: add missing " Fiona Ebner
2025-07-18  9:30 ` Fiona Ebner [this message]
2025-07-18  9:30 ` [pve-devel] [PATCH manager 7/9] api: replication: fix usages of RPCEnvironment check method Fiona Ebner
2025-07-18  9:30 ` [pve-devel] [PATCH manager 8/9] close #2809: api: replication: use VM.Replicate privilege Fiona Ebner
2025-07-18  9:30 ` [pve-devel] [PATCH docs 9/9] user management: privileges: document " Fiona Ebner
2025-07-30 13:33 ` [pve-devel] applied-series: [PATCH access-control/manager/docs 0/9] close #2809: replication: add dedicated " Fabian Grünbichler

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=20250718093024.55570-7-f.ebner@proxmox.com \
    --to=f.ebner@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal