Skip to content

Commit

Permalink
[API] Using isAccessibleBy on candidate endpoint (#8824)
Browse files Browse the repository at this point in the history
Add accessibility check for candidate metadata, not just visits.
  • Loading branch information
xlecours authored Jul 4, 2023
1 parent c521659 commit f8f123d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/api/php/endpoints/candidates.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ class Candidates extends Endpoint implements \LORIS\Middleware\ETagCalculator

$candidate = \NDB_Factory::singleton()->candidate($candID);

if (!$candidate->isAccessibleBy($user)) {
return new \LORIS\Http\Response\JSON\Forbidden();
}

$endpoint = new Candidate\Candidate($candidate);

$pathparts = array_slice($pathparts, 2);
Expand Down

0 comments on commit f8f123d

Please # to comment.