Added organisation graph endpoint and tests
This commit is contained in:
parent
7ed2636978
commit
3ae8a43df4
5 changed files with 214 additions and 0 deletions
21
lib/Pear/LocalLoop/Controller/Api/V1/Organisation.pm
Normal file
21
lib/Pear/LocalLoop/Controller/Api/V1/Organisation.pm
Normal file
|
@ -0,0 +1,21 @@
|
|||
package Pear::LocalLoop::Controller::Api::V1::Organisation;
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
|
||||
sub auth {
|
||||
my $c = shift;
|
||||
|
||||
return 1 if $c->stash->{api_user}->type eq 'organisation';
|
||||
|
||||
$c->render(
|
||||
json => {
|
||||
success => Mojo::JSON->false,
|
||||
message => 'Not an Organisation',
|
||||
error => 'user_not_org',
|
||||
},
|
||||
status => 403,
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
1;
|
Reference in a new issue