summaryrefslogtreecommitdiff
path: root/certs/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-02-07 14:38:56 +0100
committerAzul <azul@leap.se>2014-02-10 14:26:30 +0100
commit3f9dc65636afb57fed441978dca4bf7d3209bd2d (patch)
treea3ede0e3b6e1f2ea952848f2c3b5b62249105d76 /certs/app
parente1243d02953b4012d6bb216efc9b0606809ab4bb (diff)
rename authorize to require_login
authorize_admin -> require_admin also add require_token which will ensure token has been used for auth.
Diffstat (limited to 'certs/app')
-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.
#