# -*- encoding : utf-8 -*-

class ApplicationController < ActionController::Base
  protect_from_forgery
  
  helper_method :has_permission?
  
  
  
  
  def has_permission?(text)
    true
  end
  
  
  def auth_fuser
    if !current_fuser
      redirect_to new_forum_auth_path
    end
      
    
  end
  
  
  private

    def current_fuser
      if session[:forum_user_id] and ForumUser.exists?(session[:forum_user_id])
        @current_fuser = ForumUser.find(session[:forum_user_id])
      else
        nil
      end
     
    end
    
    def moderator?
      true if current_admin
    end
    
    
    helper_method :current_fuser, :moderator?
end
