From 494ebdab860a4db792e1c61836f1efcb7593dfe7 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 25 Feb 2013 13:15:50 +0100 Subject: added configuration setting for disabling free certs --- certs/app/controllers/certs_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'certs/app') 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 -- cgit v1.2.3