Sha256: 4afa56abb2c4c9bc9517839c08725d2aee24c92063bd9f5b670c3e9f4b8f6f9a

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

module Spree
  module PermissionSets
    # 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 ConfigurationDisplay < PermissionSets::Base
      class << self
        def privilege
          :display
        end

        def category
          :configuration
        end
      end

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_core-4.4.2 lib/spree/permission_sets/configuration_display.rb
solidus_core-4.4.1 lib/spree/permission_sets/configuration_display.rb
solidus_core-4.4.0 lib/spree/permission_sets/configuration_display.rb