th: app: api: base_controller: allow API access to be configurable
This commit is contained in:
parent
9ee65200fd
commit
5b92324e54
1 changed files with 7 additions and 1 deletions
|
@ -133,7 +133,13 @@ class Api::BaseController < ApplicationController
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue