Sha256: 64cc0eb9bc739d190dee3be951facf8bea1f22ad1986543b1b09509edd90d133

Contents?: true

Size: 623 Bytes

Versions: 26

Compression:

Stored size: 623 Bytes

Contents

module Spree
  module PermissionSets
    class UserManagement < PermissionSets::Base
      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
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
solidus_core-2.5.2 lib/spree/permission_sets/user_management.rb
solidus_core-2.5.1 lib/spree/permission_sets/user_management.rb
solidus_core-2.5.0 lib/spree/permission_sets/user_management.rb
solidus_core-2.5.0.rc1 lib/spree/permission_sets/user_management.rb
solidus_core-2.5.0.beta2 lib/spree/permission_sets/user_management.rb
solidus_core-2.5.0.beta1 lib/spree/permission_sets/user_management.rb
solidus_core-2.4.2 lib/spree/permission_sets/user_management.rb
solidus_core-2.3.1 lib/spree/permission_sets/user_management.rb
solidus_core-2.4.1 lib/spree/permission_sets/user_management.rb
solidus_core-2.2.2 lib/spree/permission_sets/user_management.rb
solidus_core-2.1.1 lib/spree/permission_sets/user_management.rb
solidus_core-2.4.0 lib/spree/permission_sets/user_management.rb
solidus_core-2.4.0.rc1 lib/spree/permission_sets/user_management.rb
solidus_core-2.4.0.beta1 lib/spree/permission_sets/user_management.rb
solidus_core-2.3.0 lib/spree/permission_sets/user_management.rb
solidus_core-2.3.0.rc3 lib/spree/permission_sets/user_management.rb
solidus_core-2.3.0.rc2 lib/spree/permission_sets/user_management.rb
solidus_core-2.3.0.rc1 lib/spree/permission_sets/user_management.rb
solidus_core-2.3.0.beta1 lib/spree/permission_sets/user_management.rb
solidus_core-2.2.1 lib/spree/permission_sets/user_management.rb