diff --git a/lib/NGCP/Panel/Role/API/Capabilities.pm b/lib/NGCP/Panel/Role/API/Capabilities.pm index 57e23b1ffe..39093b7f60 100644 --- a/lib/NGCP/Panel/Role/API/Capabilities.pm +++ b/lib/NGCP/Panel/Role/API/Capabilities.pm @@ -68,23 +68,8 @@ sub _item_rs { $rtcengine &= ($c->user->reseller->rtc_user // 0); } else { - $rtcengine &= ($c->user->voip_subscriber->contract->contact->reseller->rtc_user // 0); - - my $customer_rs = NGCP::Panel::Utils::Contract::get_customer_rs( - c => $c, - contract_id => $c->user->account_id, - ); - $customer_rs = $customer_rs->search({ - '-or' => [ - 'product.class' => 'sipaccount', - 'product.class' => 'pbxaccount', - ], - },{ - '+select' => [ 'product.class' ], - '+as' => [ 'product_class' ], - }); - my $customer = $customer_rs->first; - + my $customer = $c->user->voip_subscriber->contract; + $rtcengine &= ($customer->contact->reseller->rtc_user // 0); my $cpbx = ($customer->product->class eq 'pbxaccount') ? 1 : 0; $cloudpbx &= $cpbx;