summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2011-08-27 21:38:15 +0200
committerAlex Legler <alex@a3li.li>2011-08-27 21:38:15 +0200
commit8296fc2a1cff87dd7ff3d66e7a8d72e5fcc54c3a (patch)
treed7164180b908bb18ce1af00ad4fa6f020eacda25 /lib/authentication.rb
parentMigrate user administration to rails 3 (diff)
downloadglsamaker-8296fc2a1cff87dd7ff3d66e7a8d72e5fcc54c3a.tar.gz
glsamaker-8296fc2a1cff87dd7ff3d66e7a8d72e5fcc54c3a.tar.bz2
glsamaker-8296fc2a1cff87dd7ff3d66e7a8d72e5fcc54c3a.zip
Move admin filter to the Authentication module
Diffstat (limited to 'lib/authentication.rb')
-rw-r--r--lib/authentication.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/authentication.rb b/lib/authentication.rb
index ea0a2b4..6f162e3 100644
--- a/lib/authentication.rb
+++ b/lib/authentication.rb
@@ -54,6 +54,14 @@ module Authentication
end
end
end
+
+ # Filter for admin pages
+ def admin_access_required
+ unless current_user.is_el_jefe?
+ deny_access "Admin interface"
+ false
+ end
+ end
# Returns the ActiveRecord object of the currently logged in user
def current_user