Dependencies update and use adapter's url_name instaid of the given name for index lookup for consistent url and index path locations

This commit is contained in:
2018-08-29 11:34:45 -05:00
parent 1428d0ce1b
commit bc636294c6
8 changed files with 79 additions and 84 deletions
@@ -8,8 +8,8 @@ module Dunlop
def ember_path
app_globals = {}
if adapter_name = params[:adapter].to_s.scan(/\w+/).first.presence
app_index = Rails.root.join("public/adapters/#{adapter_name}/app/index.html")
return render text: 'unauthorized, no adapter engine', status: 403 unless adapter = Panda.adapters[adapter_name]
app_index = Rails.root.join("public/adapters/#{adapter.url_name}/app/index.html")
#app_globals = adapter.settings # load through request instead. More stable then changing environments
unless Rails.application.config.try(:loose_ember_app_authorization)
return render text: 'unauthorized, no adapter engine', status: 403 unless current_user.admin? or authorize!(:read, adapter.engine)