app/controllers/alchemy/base_controller.rb in alchemy_cms-2.6.3 vs app/controllers/alchemy/base_controller.rb in alchemy_cms-2.7.0

- old
+ new

@@ -1,9 +1,8 @@ -# This is the main Alchemy controller all other controllers inheret from. +# This is the main Alchemy controller all other controllers inherit from. module Alchemy class BaseController < ApplicationController - include Alchemy::Modules protect_from_forgery before_filter :set_current_site @@ -137,19 +136,10 @@ def mailer_set_url_options ActionMailer::Base.default_url_options[:host] = request.host_with_port end - def hashified_options - return nil if params[:options].blank? - if params[:options].is_a?(String) - Rack::Utils.parse_query(params[:options]) - else - params[:options] - end - end - # Returns the layout to be used by the current page. This method is being # used in PageController#show's invocation of #render. # # It allows you to request a specific page layout by passing a 'layout' parameter # in a request. If this parameter is set to 'none' or 'false', no layout whatsoever @@ -202,17 +192,15 @@ protected def permission_denied if current_user - if permitted_to? :index_alchemy_admin_dashboard + if permitted_to? :index, :alchemy_admin_dashboard if request.referer == alchemy.login_url render :file => Rails.root.join('public/422'), :status => 422 elsif request.xhr? respond_to do |format| - format.js { - render :js => "Alchemy.growl('#{_t('You are not authorized')}', 'warning'); Alchemy.Buttons.enable();" - } + format.js { render status: 403 } format.html { render :partial => 'alchemy/admin/partials/flash', :locals => {:message => _t('You are not authorized'), :flash_type => 'warning'} } end else