blob: c8a821cf7b643ec930dc78ae32b4f6692305521a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
module PolicyChecker
extend ActiveSupport::Concern
included do
before_action :authorize_resource, except: [:create, :index, :new]
before_action :authorize_resource_class, only: [:create, :index, :new]
end
protected
def authorize_resource
authorize resource
end
def authorize_resource_class
authorize resource_class
end
end
|