Sha256: 0179d3b5bcf26dcf246a0560bbe5b78c864a2b75debc40df715584964133f355

Contents?: true

Size: 432 Bytes

Versions: 6

Compression:

Stored size: 432 Bytes

Contents

CanCan::ControllerAdditions.class_eval do
  # specs of #authorize_with_attributes! is written in authorize_admin in roles_controller_spec 
  def authorize_with_attributes!(action, subject, attributes = [])
    attributes = attributes.keys if attributes.is_a?(Hash)
    if attributes.is_a? Array
      attributes.each { |attribute| authorize!(action, subject, attribute) }
    else
      authorize!(action, subject)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_admin_roles_and_access-2.0.0 config/initializers/cancan_controller_additions.rb
spree_admin_roles_and_access-1.3.0 config/initializers/cancan_controller_additions.rb
spree_admin_roles_and_access-1.2.1 config/initializers/cancan_controller_additions.rb
spree_admin_roles_and_access-1.2.0 config/initializers/cancan_controller_additions.rb
spree_admin_roles_and_access-1.1.0 config/initializers/cancan_controller_additions.rb
spree_admin_roles_and_access-1.0.0 config/initializers/cancan_controller_additions.rb