From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Alexander Zeidler <a.zeidler@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager 1/4] api: backup: refactor backup permission check
Date: Wed, 14 Jun 2023 11:49:09 +0200 [thread overview]
Message-ID: <2f89c63e-1b97-39a8-b2b0-463bae5ef84d@proxmox.com> (raw)
In-Reply-To: <20230613134254.153081-2-a.zeidler@proxmox.com>
Am 13.06.23 um 15:42 schrieb Alexander Zeidler:
> Unify style before adding another parameter check
>
> Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
> ---
> PVE/API2/Backup.pm | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/PVE/API2/Backup.pm b/PVE/API2/Backup.pm
> index 45eb47e2..cae889f4 100644
> --- a/PVE/API2/Backup.pm
> +++ b/PVE/API2/Backup.pm
> @@ -49,8 +49,11 @@ 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})) {
> - $rpcenv->check($user, "/", [ 'Sys.Modify' ]);
> + for my $key (qw(bwlimit ionice performance)) {
> + if (defined($param->{$key})) {
> + $rpcenv->check($user, "/", [ 'Sys.Modify' ]);
> + last;
> + }
Style nit: using something like
if ( grep { defined($_); } qw(...) ) {
would keep the line count low ;)
> }
> }
>
next prev parent reply other threads:[~2023-06-14 9:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 13:42 [pve-devel] [PATCH manager/container/guest-common 0/4] fix #3069: add pbs-entries-max to vzdump.conf Alexander Zeidler
2023-06-13 13:42 ` [pve-devel] [PATCH manager 1/4] api: backup: refactor backup permission check Alexander Zeidler
2023-06-14 9:49 ` Fiona Ebner [this message]
2023-06-13 13:42 ` [pve-devel] [PATCH manager 2/4] add 'pbs-entries-max' to permission check & config Alexander Zeidler
2023-06-13 13:42 ` [pve-devel] [PATCH container 3/4] add 'pbs-entries-max' parameter Alexander Zeidler
2023-06-14 9:49 ` Fiona Ebner
2023-06-13 13:42 ` [pve-devel] [PATCH guest-common 4/4] vzdump: schema: add 'pbs-entries-max' property Alexander Zeidler
2023-06-14 9:49 ` Fiona Ebner
2023-06-14 12:51 ` Fiona Ebner
2023-06-14 13:57 ` Thomas Lamprecht
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=2f89c63e-1b97-39a8-b2b0-463bae5ef84d@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=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