Sha256: 0c511577a0b5788e2871a4bd763fde6d688692fbf979b7a81df8b55301aa46a0

Contents?: true

Size: 654 Bytes

Versions: 43

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

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

43 entries across 43 versions & 2 rubygems

Version Path
solidus_core-2.9.6 lib/spree/permission_sets/user_management.rb
solidus_core-2.8.6 lib/spree/permission_sets/user_management.rb
solidus_core-2.9.5 lib/spree/permission_sets/user_management.rb
solidus_core-2.9.4 lib/spree/permission_sets/user_management.rb
solidus_core-2.6.6 lib/spree/permission_sets/user_management.rb
solidus_core-2.7.4 lib/spree/permission_sets/user_management.rb
solidus_core-2.8.5 lib/spree/permission_sets/user_management.rb
solidus_core-2.9.3 lib/spree/permission_sets/user_management.rb
solidus_core-2.9.2 lib/spree/permission_sets/user_management.rb
solidus_core-2.10.0.beta1 lib/spree/permission_sets/user_management.rb
solidus_core-2.7.3 lib/spree/permission_sets/user_management.rb
solidus_core-2.6.5 lib/spree/permission_sets/user_management.rb
solidus_core-2.9.1 lib/spree/permission_sets/user_management.rb
solidus_core-2.9.0 lib/spree/permission_sets/user_management.rb
solidus_core-2.9.0.rc.1 lib/spree/permission_sets/user_management.rb
solidus_core-2.8.4 lib/spree/permission_sets/user_management.rb
solidus_core-2.8.3 lib/spree/permission_sets/user_management.rb
solidus_core-2.7.2 lib/spree/permission_sets/user_management.rb
solidus_core-2.6.4 lib/spree/permission_sets/user_management.rb
solidus_core-2.8.2 lib/spree/permission_sets/user_management.rb