api: backup: refactor backup permission check

Alter style to make the parameter check more concise

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Alexander Zeidler 2023-06-15 16:14:42 +02:00 committed by Fabian Grünbichler
parent 98cbec545f
commit c62f096e2b

View File

@ -49,7 +49,7 @@ sub assert_param_permission_common {
raise_param_exc({ $key => "Only root may set this option."}) if exists $param->{$key}; 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' ]); $rpcenv->check($user, "/", [ 'Sys.Modify' ]);
} }
} }