all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexander Zeidler <a.zeidler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v3 manager/container/guest-common/docs 1/5] api: backup: refactor backup permission check
Date: Thu, 27 Jul 2023 10:37:55 +0200	[thread overview]
Message-ID: <20230727083759.19001-2-a.zeidler@proxmox.com> (raw)
In-Reply-To: <20230727083759.19001-1-a.zeidler@proxmox.com>

Alter style to make the parameter check more concise

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
---
Changes since v2:
  * none

Changes since v1:
  Apply Fiona's comments:
  * shorten permission check


 PVE/API2/Backup.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Backup.pm b/PVE/API2/Backup.pm
index 45eb47e2..70753c2e 100644
--- a/PVE/API2/Backup.pm
+++ b/PVE/API2/Backup.pm
@@ -49,7 +49,7 @@ sub assert_param_permission_common {
 	raise_param_exc({ $key => "Only root may set this option."}) if exists $param->{$key};
     }
 
-    if (defined($param->{bwlimit}) || defined($param->{ionice}) || defined($param->{performance})) {
+    if (grep { defined($param->{$_}) } qw(bwlimit ionice performance)) {
 	$rpcenv->check($user, "/", [ 'Sys.Modify' ]);
     }
 }
-- 
2.39.2





  reply	other threads:[~2023-07-27  8:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  8:37 [pve-devel] [PATCH v3 manager/container/guest-common/docs 0/5] fix #3069: add pbs-entries-max to vzdump.conf Alexander Zeidler
2023-07-27  8:37 ` Alexander Zeidler [this message]
2023-07-27  8:37 ` [pve-devel] [PATCH v3 manager 2/5] fix #3069: vzdump: add property 'performance: pbs-entries-max=N' Alexander Zeidler
2023-07-27  9:05   ` Fiona Ebner
2023-07-27  8:37 ` [pve-devel] [PATCH v3 container 3/5]: fix #3069: vzdump: add 'pbs-entries-max' parameter Alexander Zeidler
2023-07-27  9:22   ` Fiona Ebner
2023-07-27  8:37 ` [pve-devel] [PATCH v3 guest-common 4/5] fix #3069: vzdump: schema: add 'pbs-entries-max' property Alexander Zeidler
2023-07-27  9:32   ` Fiona Ebner
2023-07-27  8:37 ` [pve-devel] [PATCH v3 docs 5/5] vzdump: mention new parameter 'pbs-entries-max' Alexander Zeidler

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=20230727083759.19001-2-a.zeidler@proxmox.com \
    --to=a.zeidler@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal