Class: Spree::PermissionSets::ConfigurationDisplay

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

Overview

Read-only permissions for e-commerce settings.

Roles with this permission will be able to view information, also from the admin panel, about:

  • Tax categories

  • Tax rates

  • Zones

  • Countries

  • States

  • Payment methods

  • Taxonomies

  • Shipping methods

  • Shipping categories

  • Stock locations

  • Stock movements

  • Refund reasons

  • Reimbursement types

  • Return reasons

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Class Method Details

.categoryObject



30
31
32
# File 'lib/spree/permission_sets/configuration_display.rb', line 30

def category
  :configuration
end

.privilegeObject



26
27
28
# File 'lib/spree/permission_sets/configuration_display.rb', line 26

def privilege
  :display
end

Instance Method Details

#activate!Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/spree/permission_sets/configuration_display.rb', line 35

def activate!
    can [:read, :admin], Spree::TaxCategory
    can [:read, :admin], Spree::TaxRate
    can [:read, :admin], Spree::Zone
    can [:read, :admin], Spree::Country
    can [:read, :admin], Spree::State
    can [:read, :admin], Spree::PaymentMethod
    can [:read, :admin], Spree::Taxonomy
    can [:read, :admin], Spree::ShippingMethod
    can [:read, :admin], Spree::ShippingCategory
    can [:read, :admin], Spree::StockLocation
    can [:read, :admin], Spree::StockMovement
    can [:read, :admin], Spree::RefundReason
    can [:read, :admin], Spree::ReimbursementType
    can [:read, :admin], Spree::ReturnReason
end