summaryrefslogtreecommitdiff
path: root/app/controllers/controller_extension/authentication.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-07-14 18:00:14 +0200
committerAzul <azul@leap.se>2014-07-14 18:00:14 +0200
commitbb10a669e1129c662ba01f223bd5a0ee7f2a0344 (patch)
tree264f44be78d397d81b701940fa0ac4d1eaf9a682 /app/controllers/controller_extension/authentication.rb
parent2f1ceb63bfef2fa7d92fcbad73a5ead5bd17b23e (diff)
fix controller refactor and features
Also save debug log on failing features
Diffstat (limited to 'app/controllers/controller_extension/authentication.rb')
-rw-r--r--app/controllers/controller_extension/authentication.rb23
1 files changed, 0 insertions, 23 deletions
diff --git a/app/controllers/controller_extension/authentication.rb b/app/controllers/controller_extension/authentication.rb
index 687bc6e..e2b24f0 100644
--- a/app/controllers/controller_extension/authentication.rb
+++ b/app/controllers/controller_extension/authentication.rb
@@ -26,29 +26,6 @@ module ControllerExtension::Authentication
redirect_to home_url if logged_in?
end
- def access_denied
- respond_to_error :not_authorized, :forbidden, home_url
- end
-
- def login_required
- # Warden will intercept the 401 response and call
- # SessionController#unauthenticated instead.
- respond_to_error :not_authorized_login, :unauthorized, login_url
- end
-
- def respond_to_error(message, status=nil, redirect=nil)
- message = t(message) if message.is_a?(Symbol)
- respond_to do |format|
- format.html do
- redirect_to redirect, alert: message
- end
- format.json do
- status ||= :unprocessable_entity
- render json: {error: message}, status: status
- end
- end
- end
-
def admin?
current_user.is_admin?
end