Class: Spree::PermissionSets::UserManagement Private

Inherits:
Base
  • Object
show all
Defined in:
lib/spree/permission_sets/user_management.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

#activate!Object

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
# File 'lib/spree/permission_sets/user_management.rb', line 4

def activate!
  can [:admin, :display, :create, :update, :save_in_address_book, :remove_from_address_book, :addresses, :orders, :items], Spree.user_class

  # Note: This does not work with accessible_by.
  # See https://github.com/solidusio/solidus/pull/1263
  can :update_email, Spree.user_class do |user|
    user.spree_roles.none?
  end

  cannot [:delete, :destroy], Spree.user_class
  can :manage, Spree::StoreCredit
  can :display, Spree::Role
end