diff --git a/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm b/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm index 56b1c24385..28a1bdbdf8 100644 --- a/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm +++ b/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm @@ -60,7 +60,10 @@ sub relation{ } __PACKAGE__->set_config({ - allowed_roles => [qw/admin reseller ccareadmin ccare/], + allowed_roles => { + 'Default' => [qw/admin reseller ccareadmin ccare/], + 'GET' => [qw/admin reseller ccareadmin ccare subscriberadmin subscriber/], + }, }); sub GET :Allow { diff --git a/lib/NGCP/Panel/Controller/API/SubscriberProfilesItem.pm b/lib/NGCP/Panel/Controller/API/SubscriberProfilesItem.pm index de7f39f9ff..5cafdf4888 100644 --- a/lib/NGCP/Panel/Controller/API/SubscriberProfilesItem.pm +++ b/lib/NGCP/Panel/Controller/API/SubscriberProfilesItem.pm @@ -38,6 +38,7 @@ __PACKAGE__->set_config({ allowed_roles => { Default => [qw/admin reseller ccareadmin ccare/], Journal => [qw/admin reseller ccareadmin ccare/], + 'GET' => [qw/admin reseller ccareadmin ccare subscriberadmin subscriber/], } }); diff --git a/lib/NGCP/Panel/Role/API/SubscriberProfiles.pm b/lib/NGCP/Panel/Role/API/SubscriberProfiles.pm index e77d60feb8..46e78caf39 100644 --- a/lib/NGCP/Panel/Role/API/SubscriberProfiles.pm +++ b/lib/NGCP/Panel/Role/API/SubscriberProfiles.pm @@ -20,6 +20,8 @@ sub _item_rs { $item_rs = $item_rs->search({ 'profile_set.reseller_id' => $c->user->reseller_id }, { join => 'profile_set', }); + } elsif ($c->user->roles eq "subscriber" || $c->user->roles eq "subscriberadmin") { + $item_rs = $item_rs->search({ id => $c->user->profile_id }); } return $item_rs; }