aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/concerns/policy_checker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/policy_checker.rb')
-rw-r--r--app/controllers/concerns/policy_checker.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/concerns/policy_checker.rb b/app/controllers/concerns/policy_checker.rb
index 72c18c64f..c8a821cf7 100644
--- a/app/controllers/concerns/policy_checker.rb
+++ b/app/controllers/concerns/policy_checker.rb
@@ -2,11 +2,16 @@ module PolicyChecker
extend ActiveSupport::Concern
included do
- before_action :check_policy, only: [:edit, :update, :destroy]
+ before_action :authorize_resource, except: [:create, :index, :new]
+ before_action :authorize_resource_class, only: [:create, :index, :new]
end
protected
- def check_policy
+ def authorize_resource
authorize resource
end
+
+ def authorize_resource_class
+ authorize resource_class
+ end
end