app: api: base_controller: allow API access to be configurable
parent
7ceda772e4
commit
152f5c7983
|
@ -133,8 +133,14 @@ class Api::BaseController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def disallow_unauthenticated_api_access?
|
def disallow_unauthenticated_api_access?
|
||||||
|
if ENV['DISALLOW_UNAUTHENTICATED_API_ACCESS'] == 'true'
|
||||||
|
true
|
||||||
|
elsif ENV['DISALLOW_UNAUTHENTICATED_API_ACCESS'] == 'false'
|
||||||
|
false
|
||||||
|
else
|
||||||
authorized_fetch_mode?
|
authorized_fetch_mode?
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue