diff --git a/controllers/ontologies_controller.rb b/controllers/ontologies_controller.rb index fc15d567..18ec14c5 100644 --- a/controllers/ontologies_controller.rb +++ b/controllers/ontologies_controller.rb @@ -87,8 +87,8 @@ class OntologiesController < ApplicationController get '/:acronym/download' do acronym = params["acronym"] ont = Ontology.find(acronym).include(Ontology.goo_attrs_to_load).first - ont.bring(:viewingRestriction) if ont.bring?(:viewingRestriction) error 422, "You must provide an existing `acronym` to download" if ont.nil? + ont.bring(:viewingRestriction) if ont.bring?(:viewingRestriction) check_access(ont) restricted_download = LinkedData::OntologiesAPI.settings.restrict_download.include?(acronym) error 403, "License restrictions on download for #{acronym}" if restricted_download && !current_user.admin?