summaryrefslogtreecommitdiff
path: root/certs/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2014-02-10 10:27:52 -0800
committerjessib <jessib@riseup.net>2014-02-10 10:27:52 -0800
commitb6ef51277b4e6d65cfda15f0124ae4f222f7f241 (patch)
treeda7eb2d3a3a648be0be519aae23f997f248ba320 /certs/app/controllers
parentbcdde2f6bfb4ed3a1535bd2e50ab47529a9141e2 (diff)
parentb4719619aabbe9ebf74563b62e1eb8e4fb248c21 (diff)
Merge pull request #138 from azul/feature/token-only-api-auth
Feature/token only api auth
Diffstat (limited to 'certs/app/controllers')
-rw-r--r--certs/app/controllers/certs_controller.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/certs/app/controllers/certs_controller.rb b/certs/app/controllers/certs_controller.rb
index 62ef3fd..82cbc44 100644
--- a/certs/app/controllers/certs_controller.rb
+++ b/certs/app/controllers/certs_controller.rb
@@ -1,6 +1,6 @@
class CertsController < ApplicationController
- before_filter :login_if_required
+ before_filter :require_login, :unless => :anonymous_certs_allowed?
# GET /cert
def show
@@ -10,10 +10,9 @@ class CertsController < ApplicationController
protected
- def login_if_required
- authorize unless APP_CONFIG[:allow_anonymous_certs]
+ def anonymous_certs_allowed?
+ APP_CONFIG[:allow_anonymous_certs]
end
-
#
# this is some temporary logic until we store the service level in the user db.
#