From c62f096e2b19572062697c76da21ebf8d6ebd016 Mon Sep 17 00:00:00 2001 From: Alexander Zeidler Date: Thu, 15 Jun 2023 16:14:42 +0200 Subject: [PATCH] api: backup: refactor backup permission check Alter style to make the parameter check more concise Signed-off-by: Alexander Zeidler Reviewed-by: Fiona Ebner --- 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