diff options
Diffstat (limited to 'certs/app/controllers/certs_controller.rb')
-rw-r--r-- | certs/app/controllers/certs_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/certs/app/controllers/certs_controller.rb b/certs/app/controllers/certs_controller.rb index 3b7d35d..977e03e 100644 --- a/certs/app/controllers/certs_controller.rb +++ b/certs/app/controllers/certs_controller.rb @@ -1,9 +1,16 @@ class CertsController < ApplicationController + before_filter :logged_in_or_free_certs + # GET /cert def show @cert = ClientCertificate.new(free: !logged_in?) render text: @cert.to_s, content_type: 'text/plain' end + protected + + def logged_in_or_free_certs + authorize unless APP_CONFIG[:free_certs_enabled] + end end |