[pve-devel] applied: [PATCH v2 manager 1/4] api: backup: refactor backup permission check
Fabian Grünbichler
f.gruenbichler at proxmox.com
Thu Jul 27 10:42:09 CEST 2023
applied this one with R-B, thanks!
On July 7, 2023 2:53 pm, Fiona Ebner wrote:
> Am 15.06.23 um 16:14 schrieb Alexander Zeidler:
>> Alter style to make the parameter check more concise
>>
>> Signed-off-by: Alexander Zeidler <a.zeidler at proxmox.com>
>
> Reviewed-by: Fiona Ebner <f.ebner at proxmox.com>
>
>> ---
>> Changes from v1:
>> 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' ]);
>> }
>> }
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
More information about the pve-devel
mailing list