aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5c856383b..6411cf27e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -112,5 +112,12 @@ module ApplicationHelper
return "#{exact_date} (#{ago_text})"
end
+ # Note that if the admin interface is proxied via another server, we can't
+ # rely on a sesssion being shared between the front end and admin interface,
+ # so need to check the status of the user.
+ def is_admin?
+ return !session[:using_admin].nil? || (!@user.nil? && @user.super?)
+ end
+
end