Class: Spree::PermissionSets::ConfigurationManagement

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/permission_sets/configuration_management.rb

Instance Attribute Summary

Attributes inherited from Base

#ability

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#activate!Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/models/spree/permission_sets/configuration_management.rb', line 12

def activate!
  # Store settings
  can :manage, Spree::Store

  # Payment configuration
  can :manage, Spree::PaymentMethod
  can :manage, Spree::Gateway

  # Shipping configuration
  can :manage, Spree::ShippingMethod
  can :manage, Spree::ShippingCategory
  can :manage, Spree::Zone
  can :manage, Spree::ZoneMember

  # Tax configuration
  can :manage, Spree::TaxCategory
  can :manage, Spree::TaxRate

  # General configuration
  can :manage, Spree::RefundReason
  can :manage, Spree::ReimbursementType
  can :manage, Spree::ReturnReason

  # Restrictions on immutable types
  cannot [:edit, :update], Spree::RefundReason, mutable: false
  cannot [:edit, :update], Spree::ReimbursementType, mutable: false

  # Metafield configuration
  can :manage, Spree::MetafieldDefinition

  # Policies
  can :manage, Spree::Policy
end