MT#4863 Grant access to Customer Settings for administrative subscribers.

gjungwirth/fix_tests
Andrew Pogrebennyk 12 years ago
parent 860650c135
commit abc0853521

@ -56,12 +56,18 @@ sub list_customer :Chained('/') :PathPart('customer') :CaptureArgs(0) {
my $rs = NGCP::Panel::Utils::Contract::get_contract_rs( my $rs = NGCP::Panel::Utils::Contract::get_contract_rs(
schema => $c->model('DB')); schema => $c->model('DB'));
unless($c->user->is_superuser) { if($c->user->roles eq "reseller") {
$rs = $rs->search({ $rs = $rs->search({
'contact.reseller_id' => $c->user->reseller_id, 'contact.reseller_id' => $c->user->reseller_id,
}, { }, {
join => 'contact', 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({ $rs = $rs->search({
'-or' => [ '-or' => [

Loading…
Cancel
Save