Sha256: ed5740762c5ef4cb63e1d823c31e8cd32aa1537b2a766a4764970996ddfaa7c2
Contents?: true
Size: 537 Bytes
Versions: 10
Compression:
Stored size: 537 Bytes
Contents
module AccessGranted module Rails module ControllerMethods def current_policy @current_policy ||= ::AccessPolicy.new(current_user) end def self.included(base) base.helper_method :can?, :cannot?, :current_policy if base.respond_to? :helper_method end def can?(*args) current_policy.can?(*args) end def cannot?(*args) current_policy.cannot?(*args) end def authorize!(*args) current_policy.authorize!(*args) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems