|
Lines 213-222
sub authenticate_api_request {
Link Here
|
| 213 |
|
213 |
|
| 214 |
my $permissions = $authorization->{'permissions'}; |
214 |
my $permissions = $authorization->{'permissions'}; |
| 215 |
# Check if the user is authorized |
215 |
# Check if the user is authorized |
| 216 |
if ( haspermission($user->userid, $permissions) |
216 |
if ( haspermission($user->userid, $permissions) ) { |
| 217 |
or allow_owner($c, $authorization, $user) |
217 |
$c->stash( 'grant_reason', 'permissions' ); |
| 218 |
or allow_guarantor($c, $authorization, $user) ) { |
218 |
} |
|
|
219 |
else { |
| 220 |
if ( allow_owner($c, $authorization, $user) ){ |
| 221 |
$c->stash( 'grant_reason', 'owner' ); |
| 222 |
} |
| 223 |
else { |
| 224 |
if ( allow_guarantor($c, $authorization, $user) ) { |
| 225 |
$c->stash( 'grant_reason', 'guarantor' ); |
| 226 |
} |
| 227 |
} |
| 228 |
} |
| 219 |
|
229 |
|
|
|
230 |
if ( $c->stash('grant_reason') ) { |
| 220 |
validate_query_parameters( $c, $spec ); |
231 |
validate_query_parameters( $c, $spec ); |
| 221 |
|
232 |
|
| 222 |
# Everything is ok |
233 |
# Everything is ok |
| 223 |
- |
|
|