pic_vert_app/app/controllers/application_controller.rb
2013-01-31 19:41:11 +01:00

43 lines
655 B
Ruby

# -*- 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