app/controllers/application_controller.rb
def authorize
# DEBUG
#    logger.debug "-- AUTHORIZE REQ: ctrl: #{params[:controller]}, action: #{params[:action]}"
#    logger.debug "   params: #{params.inspect}"
#    logger.debug "   session: #{session.inspect}"
#    logger.debug "   request: #{request.fullpath()}"
    unless app_status_is_ok?
      self_clean()
      redirect_to( wip_url() ) and return false
    end
    unless user = LeUser.find_by_id( session[:le_user_id] )
      session[:original_uri] = request.fullpath()
 #     logger.debug "* Session original URI set to '#{session[:original_uri]}'"
      flash[:notice] = I18n.t(:login_to_proceed)
      redirect_to( login_url() ) and return false
    else
      # Check that current user in session is REALLY authorized to reach the request.fullpath:
      unless user.can_do( params[:controller], params[:action] )
        flash[:notice] = I18n.t(:access_denied)
        redirect_to( index_url() ) and return false
      end
    end
    true
  end
# Login authorization request to be used for "sensible data operation" controllers
#
Login authorization request to be used for "sensible data operation" controllers
Login authorization request to be used for " sensible data operation " controllers
def authorize
    unless app_status_is_ok?
      self_clean()
      redirect_to( wip_url() ) and return false
    end
    unless user = LeUser.find_by_id( session[:le_user_id] )
      session[:original_uri] = request.fullpath()
      flash[:notice] = I18n.t(:login_to_proceed)
      redirect_to( login_url() ) and return false
    else
      unless user.can_do( params[:controller], params[:action] )
        flash[:notice] = I18n.t(:access_denied)
        redirect_to( index_url() ) and return false
      end
    end
    true
  end
def authorize unless app_status_is_ok? self_clean ( ) redirect_to ( wip_url ( ) ) and return false end unless user = LeUser . find_by_id ( session [ :le_user_id ] ) session [ :original_uri ] = request . fullpath ( ) flash [ :notice ] = I18n . t ( :login_to_proceed ) redirect_to ( login_url ( ) ) and return false else unless user . can_do ( params [ :controller ] , params [ :action ] ) flash [ :notice ] = I18n . t ( :access_denied ) redirect_to ( index_url ( ) ) and return false end end true end
Login authorization request to be used for "sensible data operation" controllers
Login authorization request to be used for " sensible data operation " controllers
# DEBUG #    logger.debug "-- AUTHORIZE REQ: ctrl: #{params[:controller]}, action: #{params[:action]}" #    logger.debug "   params: #{params.inspect}" #    logger.debug "   session: #{session.inspect}" #    logger.debug "   request: #{request.fullpath()}" #     logger.debug "* Session original URI set to '#{session[:original_uri]}'" # Check that current user in session is REALLY authorized to reach the request.fullpath: