module Sand::Helpers
Public Instance Methods
policy_scope(user, record)
click to toggle source
# File lib/sand/helpers.rb, line 3 def policy_scope(user, record) scoped! scope = PolicyFinder.new(record).scope! scope.new(user, record).resolve if scope end
skip_sand_scoping()
click to toggle source
# File lib/sand/helpers.rb, line 21 def skip_sand_scoping scoped! end
Private Instance Methods
scoped!()
click to toggle source
# File lib/sand/helpers.rb, line 31 def scoped! env['sand.scoped'] = true end