Class: Spree::PermissionSets::DefaultCustomer Private

Inherits:
Base
  • Object
show all
Defined in:
lib/spree/permission_sets/default_customer.rb

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

Instance Method Summary (collapse)

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Spree::PermissionSets::Base

Instance Method Details

- (Object) activate!

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.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/spree/permission_sets/default_customer.rb', line 4

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