MT#56234 fix cli check for subscriber roles

* cli preference assigned number is only checked when
  the user's role is subscriberadmin or subscriber

Change-Id: I71f9207f4705eb1ae6f4ea0810dd3a1e541144cf
mr11.2
Kirill Solomko 3 years ago
parent b838c5d0e7
commit 673ac66c70

@ -604,6 +604,7 @@ sub update_preferences {
foreach my $k(keys %{ $old_resource }) {
SWITCH: for ($k) {
/^cli$/ && do {
if ($c->user->roles eq "subscriberadmin" || $c->user->roles eq "subscriber") {
my $cli = $resource->{$k};
my @allowed_cli_numbers = $c->model('DB')->resultset('voip_dbaliases')->search({
'subscriber.account_id' => $item->contract_id,
@ -619,6 +620,7 @@ sub update_preferences {
&$err_code(HTTP_UNPROCESSABLE_ENTITY, $err_msg);
return;
}
}
last SWITCH;
};
# no special treatment for *_sound_set deletion, as id is stored in right name

Loading…
Cancel
Save