Skip to content

Commit

Permalink
check access of ontologies in /ontologies/:acronym/submissions endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Sep 21, 2023
1 parent 6d98714 commit 275b7ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/ontology_submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ class OntologySubmissionsController < ApplicationController
##
# Display all submissions of an ontology
get do
ont = Ontology.find(params["acronym"]).include(:acronym).first
ont = Ontology.find(params["acronym"]).include(:acronym, :administeredBy, :acl, :viewingRestriction).first
error 422, "Ontology #{params["acronym"]} does not exist" unless ont
check_last_modified_segment(LinkedData::Models::OntologySubmission, [ont.acronym])
check_access(ont)
ont.bring(submissions: OntologySubmission.goo_attrs_to_load(includes_param))
reply ont.submissions.sort {|a,b| b.submissionId.to_i <=> a.submissionId.to_i } # descending order of submissionId
end
Expand Down

0 comments on commit 275b7ae

Please sign in to comment.