From abc0853521e8e0317dc78f4487fa8da79a5c8901 Mon Sep 17 00:00:00 2001 From: Andrew Pogrebennyk Date: Wed, 6 Nov 2013 15:06:21 +0100 Subject: [PATCH] MT#4863 Grant access to Customer Settings for administrative subscribers. --- lib/NGCP/Panel/Controller/Customer.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Controller/Customer.pm b/lib/NGCP/Panel/Controller/Customer.pm index 4d3a0ca076..1b200c43b6 100644 --- a/lib/NGCP/Panel/Controller/Customer.pm +++ b/lib/NGCP/Panel/Controller/Customer.pm @@ -56,12 +56,18 @@ sub list_customer :Chained('/') :PathPart('customer') :CaptureArgs(0) { my $rs = NGCP::Panel::Utils::Contract::get_contract_rs( schema => $c->model('DB')); - unless($c->user->is_superuser) { + if($c->user->roles eq "reseller") { $rs = $rs->search({ 'contact.reseller_id' => $c->user->reseller_id, }, { join => 'contact', }); + } elsif($c->user->roles eq "subscriberadmin") { + $rs = $rs->search({ + 'contact.reseller_id' => $c->user->contract->contact->reseller_id, + }, { + join => 'contact', + }); } $rs = $rs->search({ '-or' => [