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
changes/74/1074/2
Andreas Granig 11 years ago
parent 6e53505c57
commit 82529daaba

@ -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;

Loading…
Cancel
Save