TT#4334 adapt soundfiles api to subadmin

* /api/soundfiles/
* /api/soundfilerecordings/

Change-Id: Ifa2685da38d240ee80c7f6fe5b65cdef2f951fb5
changes/50/10850/1
Gerhard Jungwirth 8 years ago
parent 0b999d6727
commit ab375e637b

@ -46,7 +46,7 @@ __PACKAGE__->config(
action => {
map { $_ => {
ACLDetachTo => '/api/root/invalid_user',
AllowedRole => [qw/admin reseller/],
AllowedRole => [qw/admin reseller subscriberadmin/],
Args => 0,
Does => [qw(ACL CheckTrailingSlash RequireSSL)],
Method => $_,

@ -34,7 +34,7 @@ __PACKAGE__->config(
action => {
map { $_ => {
ACLDetachTo => '/api/root/invalid_user',
AllowedRole => [qw/admin reseller/],
AllowedRole => [qw/admin reseller subscriberadmin/],
Args => 1,
Does => [qw(ACL RequireSSL)],
Method => $_,

@ -58,7 +58,7 @@ __PACKAGE__->config(
action => {
map { $_ => {
ACLDetachTo => '/api/root/invalid_user',
AllowedRole => [qw/admin reseller/],
AllowedRole => [qw/admin reseller subscriberadmin/],
Args => 0,
Does => [qw(ACL CheckTrailingSlash RequireSSL)],
Method => $_,

@ -34,7 +34,7 @@ __PACKAGE__->config(
action => {
map { $_ => {
ACLDetachTo => '/api/root/invalid_user',
AllowedRole => [qw/admin reseller/],
AllowedRole => [qw/admin reseller subscriberadmin/],
Args => 1,
Does => [qw(ACL RequireSSL)],
Method => $_,

@ -40,13 +40,21 @@ sub _item_rs {
{
prefetch => ['handle', 'set'],
});
if($c->user->roles eq "admin") {
} elsif($c->user->roles eq "reseller") {
if ($c->user->roles eq "admin") {
} elsif ($c->user->roles eq "reseller") {
$item_rs = $item_rs->search({
'set.reseller_id' => $c->user->reseller_id,
},{
join => 'set',
});
} elsif ($c->user->roles eq "subscriberadmin") {
$item_rs = $item_rs->search({
'set.contract_id' => $c->user->account_id,
},{
join => 'set',
});
} elsif ($c->user->roles eq "subscriber") {
return;
}
return $item_rs;
}

Loading…
Cancel
Save