From 82529daaba10fe0715d005f8d4cfaebeb8525d6f Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Mon, 23 Feb 2015 13:08:50 +0100 Subject: [PATCH] MT#11517 Don't expose internal prefs via API. When doing GET on /api/subscribers/123 and /api/subscriberpreferences/123 and then doing a PUT on both, the PUT on /api/subscribers/123 will change internal prefs, and the PUT on /api/subscriberpreferences/123 will override them again, causing data inconsistencies. Example is cloud_pbx_hunt_timeout, which is stored both in /api/subscribers/123 and in /api/subscriberpreferences/123, where you're not supposed to change that via /api/subscriberpreferences/123. Change-Id: I4d850482bb010377b4432ac516add94b5068f38b --- lib/NGCP/Panel/Role/API/Preferences.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Role/API/Preferences.pm b/lib/NGCP/Panel/Role/API/Preferences.pm index 0e7fe37897..6d66da1a22 100644 --- a/lib/NGCP/Panel/Role/API/Preferences.pm +++ b/lib/NGCP/Panel/Role/API/Preferences.pm @@ -167,7 +167,10 @@ sub get_resource { if($attr && !$profile_attrs{$pref->attribute->id}) { $processed = 1; last SWITCH; } - last SWITCH if($pref->attribute->internal != 0); + if($pref->attribute->internal != 0) { + $processed = 1; + last SWITCH; + } } # SWITCH next if $processed;