|
|
|
|
@ -39,7 +39,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 => $_,
|
|
|
|
|
@ -47,7 +47,7 @@ __PACKAGE__->config(
|
|
|
|
|
} } @{ __PACKAGE__->allowed_methods }),
|
|
|
|
|
@{ __PACKAGE__->get_journal_action_config(__PACKAGE__->resource_name,{
|
|
|
|
|
ACLDetachTo => '/api/root/invalid_user',
|
|
|
|
|
AllowedRole => [qw/admin reseller/],
|
|
|
|
|
AllowedRole => [qw/admin reseller subscriberadmin/],
|
|
|
|
|
Does => [qw(ACL RequireSSL)],
|
|
|
|
|
}) }
|
|
|
|
|
},
|
|
|
|
|
@ -59,6 +59,7 @@ sub auto :Private {
|
|
|
|
|
|
|
|
|
|
$self->set_body($c);
|
|
|
|
|
$self->log_request($c);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sub GET :Allow {
|
|
|
|
|
@ -72,9 +73,8 @@ sub GET :Allow {
|
|
|
|
|
|
|
|
|
|
my $response = HTTP::Response->new(HTTP_OK, undef, HTTP::Headers->new(
|
|
|
|
|
(map { # XXX Data::HAL must be able to generate links with multiple relations
|
|
|
|
|
s|rel="(http://purl.org/sipwise/ngcp-api/#rel-resellers)"|rel="item $1"|;
|
|
|
|
|
s/rel=self/rel="item self"/;
|
|
|
|
|
$_
|
|
|
|
|
s|rel="(http://purl.org/sipwise/ngcp-api/#rel-\w+)"|rel="item $1"|r =~
|
|
|
|
|
s/rel=self/rel="item self"/r;
|
|
|
|
|
} $hal->http_headers),
|
|
|
|
|
), $hal->as_json);
|
|
|
|
|
$c->response->headers($response->headers);
|
|
|
|
|
|