From 90c2eda3998d32f743f1d9848a5a666f2c3a9a90 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Sat, 28 Jun 2014 14:29:51 +0200 Subject: [PATCH] MT#7789 API: Clear special preferences on PUT --- lib/NGCP/Panel/Role/API/Preferences.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/NGCP/Panel/Role/API/Preferences.pm b/lib/NGCP/Panel/Role/API/Preferences.pm index c1ccf4f9ca..b343bb81a5 100644 --- a/lib/NGCP/Panel/Role/API/Preferences.pm +++ b/lib/NGCP/Panel/Role/API/Preferences.pm @@ -327,9 +327,20 @@ sub update_item { return; } - # make sure to not clear any internal prefs + # make sure to not clear any internal prefs, except for those defined + # in extra: + my $extra = [qw/ + rewrite_caller_in_dpid rewrite_caller_out_dpid + rewrite_callee_in_dpid rewrite_callee_out_dpid + ncos_id adm_ncos_id + sound_set contract_sound_set + allowed_ips_grp man_allowed_ips_grp + /]; $full_rs = $full_rs->search({ - 'attribute.internal' => 0, + -or => [ + 'attribute.internal' => 0, + 'attribute.attribute' => { 'in' => $extra }, + ] },{ join => 'attribute', });