app/controllers/effective/assets_controller.rb in effective_assets-1.6.2 vs app/controllers/effective/assets_controller.rb in effective_assets-1.6.3

- old
+ new

@@ -2,25 +2,25 @@ module Effective class AssetsController < ApplicationController layout false - def index # This is the Modal dialog that is read by CKEDITOR + # iframe + def index # This is the IFRAME modal dialog that is read by CKEDITOR EffectiveAssets.authorized?(self, :index, Effective::Asset.new(:user_id => current_user.try(:id))) - @assets = Effective::Asset.where(:user_id => current_user.try(:id)) - @aws_acl = EffectiveAssets.aws_acl.presence || 'public-read' + effective_iframe_uploads = Effective::Attachment.where(box: EffectiveAssets::IFRAME_UPLOADS).pluck(:asset_id) + @assets = Effective::Asset.where(id: effective_iframe_uploads) if params[:only] == 'images' @assets = @assets.images @file_types = [:jpg, :gif, :png, :bmp, :ico] - @aws_acl = 'public-read' # The CKEditor Insert Image functionality needs a public-read image here elsif params[:only] == 'nonimages' @assets = @assets.nonimages @file_types = [:pdf, :zip, :doc, :docx, :xls, :xlsx, :txt, :csv, :avi, :m4v, :m2v, :mov, :mp3, :mp4, :eml] end - @user_uploads = UserUploads.new(@assets) + @user_uploads = IframeUploads.new(@assets) render :file => 'effective/assets/iframe' end def destroy