app: api: base_controller: allow API access to be configurable

rebase/4.0.0rc2
Ariadne Conill 2022-11-06 19:13:50 +00:00
parent 7ceda772e4
commit 152f5c7983
1 changed files with 7 additions and 1 deletions

View File

@ -133,7 +133,13 @@ class Api::BaseController < ApplicationController
end end
def disallow_unauthenticated_api_access? def disallow_unauthenticated_api_access?
authorized_fetch_mode? if ENV['DISALLOW_UNAUTHENTICATED_API_ACCESS'] == 'true'
true
elsif ENV['DISALLOW_UNAUTHENTICATED_API_ACCESS'] == 'false'
false
else
authorized_fetch_mode?
end
end end
private private