Module: Spree::TestingSupport::AuthorizationHelpers::CustomAbility Private

Included in:
Controller, Request
Defined in:
lib/spree/testing_support/authorization_helpers.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#build_ability(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
8
9
10
11
# File 'lib/spree/testing_support/authorization_helpers.rb', line 5

def build_ability(&block)
  block ||= proc{ |_u| can :manage, :all }
  Class.new do
    include CanCan::Ability
    define_method(:initialize, block)
  end
end