Sha256: 50c20f8bac81ef40633ef34204dfc461fb2e05b729d5f71e225084710be55a62

Contents?: true

Size: 686 Bytes

Versions: 7

Compression:

Stored size: 686 Bytes

Contents

module Spree
  module Admin
    module Actions
      class UsersDefaultActionsBuilder
        include Spree::Core::Engine.routes.url_helpers

        def build
          root = Root.new
          add_new_user_action(root)
          root
        end

        private

        def add_new_user_action(root)
          action =
            ActionBuilder.new('new_user', new_admin_user_path).
            with_icon_key('add.svg').
            with_style(::Spree::Admin::Actions::ActionStyle::PRIMARY).
            with_id('admin_new_user_link').
            with_create_ability_check(::Spree.user_class).
            build

          root.add(action)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_backend-4.8.4 app/models/spree/admin/actions/users_default_actions_builder.rb
spree_backend-4.8.3 app/models/spree/admin/actions/users_default_actions_builder.rb
spree_backend-4.8.2 app/models/spree/admin/actions/users_default_actions_builder.rb
spree_backend-4.8.1 app/models/spree/admin/actions/users_default_actions_builder.rb
spree_backend-4.7.2 app/models/spree/admin/actions/users_default_actions_builder.rb
spree_backend-4.7.1 app/models/spree/admin/actions/users_default_actions_builder.rb
spree_backend-4.7.0 app/models/spree/admin/actions/users_default_actions_builder.rb