Sha256: 8c40b5355d30a4baa9efba2a034e96e74fc33ccfc28b76e3ac37f818f4ee9d91

Contents?: true

Size: 1.17 KB

Versions: 22

Compression:

Stored size: 1.17 KB

Contents

module Spree
  module PermissionSets
    class DefaultCustomer < PermissionSets::Base
      def activate!
        can :display, Country
        can :display, OptionType
        can :display, OptionValue
        can :create, Order
        can [:read, :update], Order do |order, token|
          order.user == user || (order.guest_token.present? && token == order.guest_token)
        end
        can :create, ReturnAuthorization do |return_authorization|
          return_authorization.order.user == user
        end
        can [:display, :update], CreditCard, user_id: user.id
        can :display, Product
        can :display, ProductProperty
        can :display, Property
        can :create, Spree.user_class
        can [:read, :update, :update_email], Spree.user_class, id: user.id
        can :display, State
        can :display, StockItem, stock_location: { active: true }
        can :display, StockLocation, active: true
        can :display, Taxon
        can :display, Taxonomy
        can [:save_in_address_book, :remove_from_address_book], Spree.user_class, id: user.id
        can [:display, :view_out_of_stock], Variant
        can :display, Zone
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
solidus_core-2.5.2 lib/spree/permission_sets/default_customer.rb
solidus_core-2.5.1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.5.0 lib/spree/permission_sets/default_customer.rb
solidus_core-2.5.0.rc1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.5.0.beta2 lib/spree/permission_sets/default_customer.rb
solidus_core-2.5.0.beta1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.4.2 lib/spree/permission_sets/default_customer.rb
solidus_core-2.3.1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.4.1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.2.2 lib/spree/permission_sets/default_customer.rb
solidus_core-2.4.0 lib/spree/permission_sets/default_customer.rb
solidus_core-2.4.0.rc1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.4.0.beta1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.3.0 lib/spree/permission_sets/default_customer.rb
solidus_core-2.3.0.rc3 lib/spree/permission_sets/default_customer.rb
solidus_core-2.3.0.rc2 lib/spree/permission_sets/default_customer.rb
solidus_core-2.3.0.rc1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.3.0.beta1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.2.1 lib/spree/permission_sets/default_customer.rb
solidus_core-2.2.0 lib/spree/permission_sets/default_customer.rb