From 02153de8b0ae2dbeea769df7488449ffa2bf2757 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Thu, 23 Mar 2017 05:47:37 -0400 Subject: [PATCH] Added before filters add_customer, view_customer --- app/controllers/customers_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/customers_controller.rb b/app/controllers/customers_controller.rb index 55892b7..821f1a2 100644 --- a/app/controllers/customers_controller.rb +++ b/app/controllers/customers_controller.rb @@ -27,7 +27,8 @@ class CustomersController < ApplicationController include SortHelper helper :timelog - before_filter :require_user + before_filter :add_customer, :only => :new + before_filter :view_customer, :except => :new skip_before_filter :verify_authenticity_token, :check_if_login_required, :only => [:view] default_search_scope :names @@ -145,11 +146,11 @@ class CustomersController < ApplicationController private def add_customer - check_permission(:add_customer) + global_check_permission(:add_customer) end def view_customer - check_permission(:view_customer) + global_check_permission(:view_customer) end def only_one_non_zero?( array )