Class: Spree::PermissionSets::ProductDisplay

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

Overview

Read-only permissions for products.

This permission set allows users to view all related information about products, also from the admin panel, including:

  • Products

  • Images

  • Variants

  • Option values

  • Product properties

  • Option types

  • Properties

  • Taxonomies

  • Taxons

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



25
26
27
# File 'lib/spree/permission_sets/product_display.rb', line 25

def category
  :product
end

.privilegeObject



21
22
23
# File 'lib/spree/permission_sets/product_display.rb', line 21

def privilege
  :display
end

Instance Method Details

#activate!Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/spree/permission_sets/product_display.rb', line 30

def activate!
  can [:read, :admin, :edit], Spree::Product
  can [:read, :admin], Spree::Image
  can [:read, :admin], Spree::Variant
  can [:read, :admin], Spree::OptionValue
  can [:read, :admin], Spree::ProductProperty
  can [:read, :admin], Spree::OptionType
  can [:read, :admin], Spree::Property
  can [:read, :admin], Spree::Taxonomy
  can [:read, :admin], Spree::Taxon
end