aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-11-22 09:49:24 +0000
committerLouise Crow <louise.crow@gmail.com>2012-11-22 09:49:24 +0000
commit09ffe8277417a1e486ae60db3254d511b4c64d33 (patch)
tree245f90f83681210ceec19a35f29fbf0e06c10252 /app/helpers/application_helper.rb
parent766da660994dbe7c86f556d9cf863411814622fe (diff)
parent640aa149fd321658a33466df7b53947b78bccd81 (diff)
Merge branch 'develop' into wdtk
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