complete visitor dashbroad

This commit is contained in:
Matthew K. Fu JuYuan authored and Christophe Vilayphiou committed 2012-09-12 16:20:15 +08:00
1 parent 803f83b239
commit 98e8f5f607
5 files changed
+37 -19

No files matched your search

+17 -17
View File
@@ -48,29 +48,29 @@ class ApplicationController < ActionController::Base
redirect_to root_path
end
# Check if the current_user is admin
# Check if the current_user is admin,if not redirect
def is_admin?
current_or_guest_user.admin? ? true : auth_failed_in_backend
end
def is_manager?
@module_app.is_manager?(current_or_guest_user) || is_admin?
end
# def is_manager?
# @module_app.is_manager?(current_or_guest_user) || is_admin?
# end
# Check if the current_user is admin
def is_member?
if (current_user rescue false)
return true
end
return false
end
# # Check if the current_user is admin
# def is_member?
# if (current_user rescue false)
# return true
# end
# return false
# end
def is_guest?
if session[:guest_user_id]
return true
end
return false
end
# def is_guest?
# if session[:guest_user_id]
# return true
# end
# return false
# end
def for_admin_only
if is_admin?