Closed renius closed 4 years ago
…ssing in ability
Hi!
I want to be able to have something less ambiguous than ArgumentError. 1) to separate kan errors from others 2) to catch it more accurately
ability = Kan::Application.new( user: UserAbilities.new, post: PostAbilities.new ) def is_it_possible? %i[user post unmanaged].sample do |resource| ability[[resource, action].join('.')].call(alien, _) end rescue MissingScopeError default_rule end
Best, Anton
…ssing in ability
Hi!
I want to be able to have something less ambiguous than ArgumentError. 1) to separate kan errors from others 2) to catch it more accurately
Best, Anton