From 9ae2c5961a175039d5d6e25241a9c6eb2ccefcec Mon Sep 17 00:00:00 2001 From: Eduardo Antonio Niehues Date: Thu, 11 Jul 2019 16:54:46 -0300 Subject: [PATCH] Spree 4.0, 4.1 --- Appraisals | 36 +- Rakefile | 2 +- .../spree/admin/base_controller_decorator.rb | 27 -- .../spree/admin/base_controller_decorator.rb | 36 ++ app/models/spree/ability_decorator.rb | 28 -- app/models/spree/role_decorator.rb | 18 - app/models/spree/user_decorator.rb | 5 - .../spree/ability_decorator.rb | 31 ++ .../spree/role_decorator.rb | 25 + .../spree/user_decorator.rb | 11 + gemfiles/spree_3_7.gemfile.lock | 431 ++++++++++++++++ gemfiles/spree_4_0.gemfile | 8 + gemfiles/spree_4_0.gemfile.lock | 439 +++++++++++++++++ gemfiles/spree_4_1.gemfile | 8 + gemfiles/spree_4_1.gemfile.lock | 447 +++++++++++++++++ gemfiles/spree_master.gemfile.lock | 459 ++++++++++++++++++ lib/spree/permissions.rb | 8 +- lib/spree_admin_roles_and_access/engine.rb | 3 +- spree_admin_roles_and_access.gemspec | 4 +- 19 files changed, 1919 insertions(+), 107 deletions(-) delete mode 100644 app/controllers/spree/admin/base_controller_decorator.rb create mode 100644 app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb delete mode 100644 app/models/spree/ability_decorator.rb delete mode 100644 app/models/spree/role_decorator.rb delete mode 100644 app/models/spree/user_decorator.rb create mode 100644 app/models/spree_admin_roles_and_access/spree/ability_decorator.rb create mode 100644 app/models/spree_admin_roles_and_access/spree/role_decorator.rb create mode 100644 app/models/spree_admin_roles_and_access/spree/user_decorator.rb create mode 100644 gemfiles/spree_3_7.gemfile.lock create mode 100644 gemfiles/spree_4_0.gemfile create mode 100644 gemfiles/spree_4_0.gemfile.lock create mode 100644 gemfiles/spree_4_1.gemfile create mode 100644 gemfiles/spree_4_1.gemfile.lock create mode 100644 gemfiles/spree_master.gemfile.lock diff --git a/Appraisals b/Appraisals index 6859991..5f4fe79 100644 --- a/Appraisals +++ b/Appraisals @@ -1,31 +1,19 @@ -appraise "spree-3-2" do - gem "spree", "~> 3.2.0" - gem "spree_auth_devise", "~> 3.2.0" -end - -appraise "spree-3-3" do - gem "spree", "~> 3.3.0" - gem "spree_auth_devise", "~> 3.3.0" -end - -appraise "spree-3-4" do - gem "spree", '~> 3.4.0' - gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master' -end - -appraise 'spree-3-5' do - gem 'spree', '~> 3.5.0' - gem 'spree_auth_devise', '~> 3.3.0' +appraise 'spree-3-7' do + gem 'spree', '~> 3.7.0' + gem 'spree_backend', '~> 3.7.0' + gem 'spree_auth_devise', '~> 3.5.0' end -appraise 'spree-3-6' do - gem 'spree', '~> 3.6.0' - gem 'spree_auth_devise', '~> 3.3.0' +appraise 'spree-4-0' do + gem 'spree', '~> 4.0.0' + gem 'spree_backend', '~> 4.0.0' + gem 'spree_auth_devise' end -appraise 'spree-3-7' do - gem 'spree', '~> 3.7.0' - gem 'spree_auth_devise', '~> 3.5.0' +appraise 'spree-4-1' do + gem 'spree', '~> 4.1.0' + gem 'spree_backend', '~> 4.1.0' + gem 'spree_auth_devise' end appraise 'spree-master' do diff --git a/Rakefile b/Rakefile index 693e483..5e8baa1 100644 --- a/Rakefile +++ b/Rakefile @@ -11,5 +11,5 @@ task default: [:spec] desc 'Generates a dummy app for testing' task :test_app do ENV['LIB_NAME'] = 'spree_admin_roles_and_access' - Rake::Task['extension:test_app'].invoke + Rake::Task['extension:test_app'].invoke('Spree::User') end diff --git a/app/controllers/spree/admin/base_controller_decorator.rb b/app/controllers/spree/admin/base_controller_decorator.rb deleted file mode 100644 index 990928f..0000000 --- a/app/controllers/spree/admin/base_controller_decorator.rb +++ /dev/null @@ -1,27 +0,0 @@ -Spree::Admin::BaseController.class_eval do - def authorize_admin - begin - if params[:id] - record = model_class.where(PARAM_ATTRIBUTE[controller_name] => params[:id]).first - elsif new_action? - record = model_class.new - else - record = model_class - end - raise if record.blank? - rescue - record = "#{params[:controller]}" - end - authorize! :admin, record - authorize_with_attributes! params[:action].to_sym, record, params[controller_name.singularize] - end - - private - def unauthorized - redirect_unauthorized_access - end - - def new_action? - NEW_ACTIONS.include?(params[:action].to_sym) - end -end diff --git a/app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb b/app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb new file mode 100644 index 0000000..1dc09b6 --- /dev/null +++ b/app/controllers/spree_admin_roles_and_access/spree/admin/base_controller_decorator.rb @@ -0,0 +1,36 @@ +module SpreeAdminRolesAndAccess + module Spree + module Admin + module BaseControllerDecorator + def authorize_admin + begin + if params[:id] + record = model_class.where(PARAM_ATTRIBUTE[controller_name] => params[:id]).first + elsif new_action? + record = model_class.new + else + record = model_class + end + raise if record.blank? + rescue + record = "#{params[:controller]}" + end + authorize! :admin, record + authorize_with_attributes! params[:action].to_sym, record, params[controller_name.singularize] + end + + private + + def unauthorized + redirect_unauthorized_access + end + + def new_action? + NEW_ACTIONS.include?(params[:action].to_sym) + end + end + end + end +end + +::Spree::Admin::BaseController.prepend SpreeAdminRolesAndAccess::Spree::Admin::BaseControllerDecorator diff --git a/app/models/spree/ability_decorator.rb b/app/models/spree/ability_decorator.rb deleted file mode 100644 index 52e9ef7..0000000 --- a/app/models/spree/ability_decorator.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Spree - Ability.class_eval do - - def initialize(user) - self.clear_aliased_actions - - alias_action :edit, to: :update - alias_action :new, to: :create - alias_action :new_action, to: :create - alias_action :show, to: :read - alias_action :index, to: :read - alias_action :delete, to: :destroy - - user ||= Spree.user_class.new - - user_roles(user).map(&:permissions).flatten.uniq.map { |permission| permission.ability(self, user) } - - Ability.abilities.each do |clazz| - ability = clazz.send(:new, user) - @rules = rules + ability.send(:rules) - end - end - - def user_roles(user) - (roles = user.roles.includes(:permissions)).empty? ? Spree::Role.default_role.includes(:permissions) : roles - end - end -end diff --git a/app/models/spree/role_decorator.rb b/app/models/spree/role_decorator.rb deleted file mode 100644 index bb1f04a..0000000 --- a/app/models/spree/role_decorator.rb +++ /dev/null @@ -1,18 +0,0 @@ -Spree::Role.class_eval do - - has_many :roles_permission_sets, dependent: :destroy - has_many :permission_sets, through: :roles_permission_sets - has_many :permissions, through: :permission_sets - - # DEPRECATED: Use permission sets instead. Only here for aiding migration for existing users - has_and_belongs_to_many :legacy_permissions, join_table: 'spree_roles_permissions', class_name: 'Spree::Permission' - - validates :name, uniqueness: true, allow_blank: true - validates :permission_sets, length: { minimum: 1, too_short: :atleast_one_permission_set_is_required }, on: :update - - def has_permission?(permission_title) - permissions.pluck(:title).include?(permission_title) - end - - scope :default_role, lambda { where(is_default: true) } -end diff --git a/app/models/spree/user_decorator.rb b/app/models/spree/user_decorator.rb deleted file mode 100644 index 35b09e7..0000000 --- a/app/models/spree/user_decorator.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Spree - Spree.user_class.class_eval do - alias_attribute :roles, :spree_roles - end -end diff --git a/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb b/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb new file mode 100644 index 0000000..355dc9d --- /dev/null +++ b/app/models/spree_admin_roles_and_access/spree/ability_decorator.rb @@ -0,0 +1,31 @@ +module SpreeAdminRolesAndAccess + module Spree + module AbilityDecorator + def initialize(user) + self.clear_aliased_actions + + alias_action :edit, to: :update + alias_action :new, to: :create + alias_action :new_action, to: :create + alias_action :show, to: :read + alias_action :index, to: :read + alias_action :delete, to: :destroy + + user ||= ::Spree.user_class.new + + user_roles(user).map(&:permissions).flatten.uniq.map { |permission| permission.ability(self, user) } + + ::Spree::Ability.abilities.each do |clazz| + ability = clazz.send(:new, user) + @rules = rules + ability.send(:rules) + end + end + + def user_roles(user) + (roles = user.roles.includes(:permissions)).empty? ? ::Spree::Role.default_role.includes(:permissions) : roles + end + end + end +end + +::Spree::Ability.prepend SpreeAdminRolesAndAccess::Spree::AbilityDecorator diff --git a/app/models/spree_admin_roles_and_access/spree/role_decorator.rb b/app/models/spree_admin_roles_and_access/spree/role_decorator.rb new file mode 100644 index 0000000..9c8a606 --- /dev/null +++ b/app/models/spree_admin_roles_and_access/spree/role_decorator.rb @@ -0,0 +1,25 @@ +module SpreeAdminRolesAndAccess + module Spree + module RoleDecorator + def self.prepended(base) + base.has_many :roles_permission_sets, dependent: :destroy + base.has_many :permission_sets, through: :roles_permission_sets + base.has_many :permissions, through: :permission_sets + + # DEPRECATED: Use permission sets instead. Only here for aiding migration for existing users + base.has_and_belongs_to_many :legacy_permissions, join_table: 'spree_roles_permissions', class_name: 'Spree::Permission' + + base.validates :name, uniqueness: true, allow_blank: true + base.validates :permission_sets, length: { minimum: 1, too_short: :atleast_one_permission_set_is_required }, on: :update + + base.scope :default_role, lambda { where(is_default: true) } + end + + def has_permission?(permission_title) + permissions.pluck(:title).include?(permission_title) + end + end + end +end + +::Spree::Role.prepend SpreeAdminRolesAndAccess::Spree::RoleDecorator diff --git a/app/models/spree_admin_roles_and_access/spree/user_decorator.rb b/app/models/spree_admin_roles_and_access/spree/user_decorator.rb new file mode 100644 index 0000000..a1ad989 --- /dev/null +++ b/app/models/spree_admin_roles_and_access/spree/user_decorator.rb @@ -0,0 +1,11 @@ +module SpreeAdminRolesAndAccess + module Spree + module UserDecorator + def self.prepended(base) + base.alias_attribute :roles, :spree_roles + end + end + end +end + +::Spree::User.prepend SpreeAdminRolesAndAccess::Spree::UserDecorator diff --git a/gemfiles/spree_3_7.gemfile.lock b/gemfiles/spree_3_7.gemfile.lock new file mode 100644 index 0000000..31d6b06 --- /dev/null +++ b/gemfiles/spree_3_7.gemfile.lock @@ -0,0 +1,431 @@ +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.4.2) + actionpack (= 5.2.4.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.4.2) + actionpack (= 5.2.4.2) + actionview (= 5.2.4.2) + activejob (= 5.2.4.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.4.2) + actionview (= 5.2.4.2) + activesupport (= 5.2.4.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.4.2) + activesupport (= 5.2.4.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.4.2) + activesupport (= 5.2.4.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (5.2.4.2) + activesupport (= 5.2.4.2) + activerecord (5.2.4.2) + activemodel (= 5.2.4.2) + activesupport (= 5.2.4.2) + arel (>= 9.0) + activestorage (5.2.4.2) + actionpack (= 5.2.4.2) + activerecord (= 5.2.4.2) + marcel (~> 0.3.1) + activesupport (5.2.4.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + acts-as-taggable-on (6.0.0) + activerecord (~> 5.0) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + arel (9.0.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap-sass (3.4.1) + autoprefixer-rails (>= 5.2.1) + sassc (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (2.3.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.0.2) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + climate_control (0.2.0) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.6.2) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 6.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.2.5) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.0.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.0.1) + kaminari-activerecord (= 1.0.1) + kaminari-core (= 1.0.1) + kaminari-actionview (1.0.1) + actionview + kaminari-core (= 1.0.1) + kaminari-activerecord (1.0.1) + activerecord + kaminari-core (= 1.0.1) + kaminari-core (1.0.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mime-types (3.3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.1009) + mimemagic (0.3.4) + mini_magick (4.9.5) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paperclip (6.1.0) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + mime-types + mimemagic (~> 0.3.0) + terrapin (~> 0.6.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyglot (0.3.5) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.13.1) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.4.2) + actioncable (= 5.2.4.2) + actionmailer (= 5.2.4.2) + actionpack (= 5.2.4.2) + actionview (= 5.2.4.2) + activejob (= 5.2.4.2) + activemodel (= 5.2.4.2) + activerecord (= 5.2.4.2) + activestorage (= 5.2.4.2) + activesupport (= 5.2.4.2) + bundler (>= 1.3.0) + railties (= 5.2.4.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.4.2) + actionpack (= 5.2.4.2) + activesupport (= 5.2.4.2) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.1.1) + actionpack (>= 5.0) + activerecord (>= 5.0) + activesupport (>= 5.0) + i18n + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.9.1) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree (3.7.10) + spree_api (= 3.7.10) + spree_backend (= 3.7.10) + spree_cmd (= 3.7.10) + spree_core (= 3.7.10) + spree_frontend (= 3.7.10) + spree_sample (= 3.7.10) + spree_api (3.7.10) + doorkeeper (~> 5.0) + fast_jsonapi (~> 1.5) + rabl (~> 0.13.1) + spree_core (= 3.7.10) + versioncake (~> 3.4.0) + spree_auth_devise (3.5.2) + devise (>= 4.4, < 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 3.1.0, < 4.0) + spree_extension + spree_backend (3.7.10) + bootstrap-sass (~> 3.4) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (= 3.5.9.1) + spree_api (= 3.7.10) + spree_core (= 3.7.10) + spree_cmd (3.7.10) + thor (~> 0.14) + spree_core (3.7.10) + activemerchant (~> 1.67) + acts-as-taggable-on (~> 6.0.0) + acts_as_list (~> 0.8) + awesome_nested_set (~> 3.2.0) + cancancan (~> 2.0) + carmen (~> 1.0.0) + deface (~> 1.0) + ffaker (~> 2.9) + friendly_id (~> 5.2.1) + highline (~> 2.0.0) + kaminari (~> 1.0.1) + mini_magick (~> 4.9.4) + monetize (~> 1.9) + money (~> 6.13) + paperclip (~> 6.1.0) + paranoia (~> 2.4.1) + premailer-rails + rails (~> 5.2.4, >= 5.2.4) + ransack (~> 2.1.1) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activerecord (~> 0.5) + stringex + twitter_cldr (~> 4.3) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + spree_frontend (3.7.10) + bootstrap-sass (~> 3.4) + canonical-rails (~> 0.2.3) + jquery-rails (~> 4.3) + spree_api (= 3.7.10) + spree_core (= 3.7.10) + spree_sample (3.7.10) + spree_core (= 3.7.10) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + terrapin (0.6.0) + climate_control (>= 0.0.3, < 1.0) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + twitter_cldr (4.4.5) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + versioncake (3.4.0) + actionpack (>= 3.2) + activesupport (>= 3.2) + railties (>= 3.2) + tzinfo + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree (~> 3.7.0) + spree_admin_roles_and_access! + spree_auth_devise (~> 3.5.0) + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/spree_4_0.gemfile b/gemfiles/spree_4_0.gemfile new file mode 100644 index 0000000..67db5ae --- /dev/null +++ b/gemfiles/spree_4_0.gemfile @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "spree", "~> 4.0.0" +gem "spree_auth_devise" + +gemspec path: "../" diff --git a/gemfiles/spree_4_0.gemfile.lock b/gemfiles/spree_4_0.gemfile.lock new file mode 100644 index 0000000..e131853 --- /dev/null +++ b/gemfiles/spree_4_0.gemfile.lock @@ -0,0 +1,439 @@ +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + mail (>= 2.7.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + nokogiri (>= 1.8.5) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + marcel (~> 0.3.1) + activesupport (6.0.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap (4.3.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (3.1.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.7.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.3.0) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + glyphicons (1.0.2) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + image_processing (1.10.3) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.4) + mini_magick (4.9.5) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyamorous (2.3.2) + activerecord (>= 5.2.1) + polyglot (0.3.5) + popper_js (1.16.0) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.14.2) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + bundler (>= 1.3.0) + railties (= 6.0.2.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.3.2) + activerecord (>= 5.2.1) + activesupport (>= 5.2.1) + i18n + polyamorous (= 2.3.2) + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-vips (2.0.17) + ffi (~> 1.9) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.9.1) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree (4.0.3) + spree_api (= 4.0.3) + spree_backend (= 4.0.3) + spree_cmd (= 4.0.3) + spree_core (= 4.0.3) + spree_frontend (= 4.0.3) + spree_sample (= 4.0.3) + spree_api (4.0.3) + doorkeeper (~> 5.2, >= 5.2.1) + fast_jsonapi (~> 1.5) + rabl (~> 0.14.2) + spree_core (= 4.0.3) + spree_auth_devise (4.0.0) + deface (~> 1.0) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 3.1.0, < 5.0) + spree_extension + spree_backend (4.0.3) + bootstrap (~> 4.3.1) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (= 3.5.9.1) + spree_api (= 4.0.3) + spree_core (= 4.0.3) + spree_cmd (4.0.3) + thor (~> 0.14) + spree_core (4.0.3) + activemerchant (~> 1.67) + acts_as_list (~> 0.8) + awesome_nested_set (>= 3.1.4, < 3.3.0) + cancancan (~> 3.0) + carmen (>= 1.0, < 1.2) + ffaker (~> 2.9) + friendly_id (>= 5.2.1, < 5.4.0) + highline (~> 2.0.0) + image_processing (~> 1.2) + kaminari (>= 1.0.1, < 1.2.0) + mini_magick (~> 4.9.4) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4.2) + premailer-rails + rails (~> 6.0.0) + ransack (~> 2.3.0) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + twitter_cldr (~> 4.3) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + spree_frontend (4.0.3) + bootstrap (~> 4.3.1) + canonical-rails (~> 0.2.5) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + spree_api (= 4.0.3) + spree_core (= 4.0.3) + spree_sample (4.0.3) + spree_core (= 4.0.3) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + twitter_cldr (4.4.5) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree (~> 4.0.0) + spree_admin_roles_and_access! + spree_auth_devise + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/spree_4_1.gemfile b/gemfiles/spree_4_1.gemfile new file mode 100644 index 0000000..a1da1cf --- /dev/null +++ b/gemfiles/spree_4_1.gemfile @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "spree", "~> 4.1.0" +gem "spree_auth_devise" + +gemspec path: "../" diff --git a/gemfiles/spree_4_1.gemfile.lock b/gemfiles/spree_4_1.gemfile.lock new file mode 100644 index 0000000..c05c00c --- /dev/null +++ b/gemfiles/spree_4_1.gemfile.lock @@ -0,0 +1,447 @@ +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + mail (>= 2.7.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + nokogiri (>= 1.8.5) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + marcel (~> 0.3.1) + activesupport (6.0.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap (4.3.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (3.1.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.7.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.3.0) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + glyphicons (1.0.2) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + image_processing (1.10.3) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + inline_svg (1.7.1) + activesupport (>= 3.0) + nokogiri (>= 1.6) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.4) + mini_magick (4.10.1) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyamorous (2.3.2) + activerecord (>= 5.2.1) + polyglot (0.3.5) + popper_js (1.16.0) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.14.2) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + bundler (>= 1.3.0) + railties (= 6.0.2.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.3.2) + activerecord (>= 5.2.1) + activesupport (>= 5.2.1) + i18n + polyamorous (= 2.3.2) + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-vips (2.0.17) + ffi (~> 1.9) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.10) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree (4.1.5) + spree_api (= 4.1.5) + spree_backend (= 4.1.5) + spree_cmd (= 4.1.5) + spree_core (= 4.1.5) + spree_frontend (= 4.1.5) + spree_sample (= 4.1.5) + spree_api (4.1.5) + doorkeeper (~> 5.2, >= 5.2.1) + fast_jsonapi (~> 1.5) + rabl (~> 0.14.2) + spree_core (= 4.1.5) + spree_auth_devise (4.1.0) + deface (~> 1.0) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 4.1.0.alpha, < 5.0) + spree_extension + spree_backend (4.1.5) + bootstrap (~> 4.3.1) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (~> 3.5.0) + spree_api (= 4.1.5) + spree_core (= 4.1.5) + spree_cmd (4.1.5) + thor (>= 0.14, < 2.0) + spree_core (4.1.5) + activemerchant (~> 1.67) + acts_as_list (~> 0.8) + awesome_nested_set (>= 3.1.4, < 3.3.0) + cancancan (~> 3.0) + carmen (>= 1.0, < 1.2) + ffaker (~> 2.9) + friendly_id (>= 5.2.1, < 5.4.0) + highline (~> 2.0.0) + image_processing (~> 1.2) + kaminari (>= 1.0.1, < 1.2.0) + mini_magick (>= 4.9.4, < 4.11.0) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4.2) + premailer-rails + rails (~> 6.0.0) + ransack (~> 2.3.0) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + twitter_cldr (>= 4.3, < 6.0) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + spree_frontend (4.1.5) + bootstrap (~> 4.3.1) + canonical-rails (~> 0.2.5) + glyphicons (~> 1.0.2) + inline_svg (~> 1.5) + jquery-rails (~> 4.3) + spree_api (= 4.1.5) + spree_core (= 4.1.5) + turbolinks (~> 5.2.0) + spree_sample (4.1.5) + spree_core (= 4.1.5) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + twitter_cldr (5.4.0) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree (~> 4.1.0) + spree_admin_roles_and_access! + spree_auth_devise + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/spree_master.gemfile.lock b/gemfiles/spree_master.gemfile.lock new file mode 100644 index 0000000..bd85c0b --- /dev/null +++ b/gemfiles/spree_master.gemfile.lock @@ -0,0 +1,459 @@ +GIT + remote: https://github.com/spree/spree.git + revision: 82c64b2f3e6a350938fd590c5fecc8d38c5c1c6a + branch: master + specs: + spree (4.2.0.alpha) + spree_api (= 4.2.0.alpha) + spree_backend (= 4.2.0.alpha) + spree_cmd (= 4.2.0.alpha) + spree_core (= 4.2.0.alpha) + spree_frontend (= 4.2.0.alpha) + spree_sample (= 4.2.0.alpha) + spree_api (4.2.0.alpha) + doorkeeper (~> 5.2, >= 5.2.1) + fast_jsonapi (~> 1.5) + rabl (~> 0.14.2) + spree_core (= 4.2.0.alpha) + spree_backend (4.2.0.alpha) + bootstrap (~> 4.3.1) + glyphicons (~> 1.0.2) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (~> 3.5.0) + spree_api (= 4.2.0.alpha) + spree_core (= 4.2.0.alpha) + spree_cmd (4.2.0.alpha) + thor (>= 0.14, < 2.0) + spree_core (4.2.0.alpha) + activemerchant (~> 1.67) + acts_as_list (~> 0.8) + awesome_nested_set (>= 3.1.4, < 3.3.0) + cancancan (~> 3.0) + carmen (>= 1.0, < 1.2) + ffaker (~> 2.9) + friendly_id (>= 5.2.1, < 5.4.0) + highline (~> 2.0.0) + image_processing (~> 1.2) + kaminari (>= 1.0.1, < 1.2.0) + mini_magick (>= 4.9.4, < 4.11.0) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4.2) + premailer-rails + rails (~> 6.0.0) + ransack (~> 2.3.0) + responders + sprockets (~> 3.7) + sprockets-rails + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + twitter_cldr (>= 4.3, < 6.0) + spree_frontend (4.2.0.alpha) + bootstrap (~> 4.3.1) + canonical-rails (~> 0.2.5) + glyphicons (~> 1.0.2) + inline_svg (~> 1.5) + jquery-rails (~> 4.3) + spree_api (= 4.2.0.alpha) + spree_core (= 4.2.0.alpha) + turbolinks (~> 5.2.0) + spree_sample (4.2.0.alpha) + spree_core (= 4.2.0.alpha) + +GIT + remote: https://github.com/spree/spree_auth_devise.git + revision: 348192110bee0b18a317322a5ebf94f7726a545b + branch: master + specs: + spree_auth_devise (4.1.0) + deface (~> 1.0) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 4.1.0.alpha, < 5.0) + spree_extension + +PATH + remote: .. + specs: + spree_admin_roles_and_access (3.pre.0.pre.stable) + spree_auth_devise + spree_core (>= 3.7.0, < 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.2.2) + actionpack (= 6.0.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + mail (>= 2.7.1) + actionmailer (6.0.2.2) + actionpack (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.2.2) + actionview (= 6.0.2.2) + activesupport (= 6.0.2.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.2) + actionpack (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + nokogiri (>= 1.8.5) + actionview (6.0.2.2) + activesupport (= 6.0.2.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.2) + activesupport (= 6.0.2.2) + globalid (>= 0.3.6) + activemerchant (1.107.1) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (6.0.2.2) + activesupport (= 6.0.2.2) + activerecord (6.0.2.2) + activemodel (= 6.0.2.2) + activesupport (= 6.0.2.2) + activestorage (6.0.2.2) + actionpack (= 6.0.2.2) + activejob (= 6.0.2.2) + activerecord (= 6.0.2.2) + marcel (~> 0.3.1) + activesupport (6.0.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2) + acts_as_list (0.9.19) + activerecord (>= 3.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + autoprefixer-rails (9.7.6) + execjs + awesome_nested_set (3.2.0) + activerecord (>= 4.0.0, < 7.0) + bcrypt (3.1.13) + bootstrap (4.3.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) + builder (3.2.4) + byebug (11.1.1) + camertron-eprun (1.1.1) + cancancan (3.1.0) + canonical-rails (0.2.8) + rails (>= 4.1, < 6.1) + capybara (3.32.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + childprocess (3.0.0) + cldr-plurals-runtime-rb (1.0.1) + cliver (0.3.2) + coderay (1.1.2) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.6) + crass (1.0.6) + css_parser (1.7.1) + addressable + database_cleaner (1.8.4) + deface (1.5.3) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.7.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + diff-lcs (1.3) + docile (1.3.2) + doorkeeper (5.3.1) + railties (>= 5) + erubi (1.9.0) + execjs (2.7.0) + factory_girl (4.9.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) + railties (>= 3.0.0) + fast_jsonapi (1.5) + activesupport (>= 4.2) + ffaker (2.14.0) + ffi (1.12.2) + friendly_id (5.3.0) + activerecord (>= 4.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + glyphicons (1.0.2) + highline (2.0.3) + htmlentities (4.3.4) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + image_processing (1.10.3) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + inline_svg (1.7.1) + activesupport (>= 3.0) + nokogiri (>= 1.6) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.1.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) + actionview + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) + activerecord + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) + launchy (2.5.0) + addressable (~> 2.7) + loofah (2.5.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.4) + mini_magick (4.10.1) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + monetize (1.9.4) + money (~> 6.12) + money (6.13.7) + i18n (>= 0.6.4, <= 2) + nio4r (2.5.2) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + orm_adapter (0.5.0) + paranoia (2.4.2) + activerecord (>= 4.0, < 6.1) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + polyamorous (2.3.2) + activerecord (>= 5.2.1) + polyglot (0.3.5) + popper_js (1.16.0) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.11.1) + actionmailer (>= 3) + premailer (~> 1.7, >= 1.7.9) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.4) + rabl (0.14.2) + activesupport (>= 2.3.14) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.2.2) + actioncable (= 6.0.2.2) + actionmailbox (= 6.0.2.2) + actionmailer (= 6.0.2.2) + actionpack (= 6.0.2.2) + actiontext (= 6.0.2.2) + actionview (= 6.0.2.2) + activejob (= 6.0.2.2) + activemodel (= 6.0.2.2) + activerecord (= 6.0.2.2) + activestorage (= 6.0.2.2) + activesupport (= 6.0.2.2) + bundler (>= 1.3.0) + railties (= 6.0.2.2) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.2.2) + actionpack (= 6.0.2.2) + activesupport (= 6.0.2.2) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + ransack (2.3.2) + activerecord (>= 5.2.1) + activesupport (>= 5.2.1) + i18n + polyamorous (= 2.3.2) + regexp_parser (1.7.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-vips (2.0.17) + ffi (~> 1.9) + rubyzip (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.2.1) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (3.5.10) + thor (~> 0.14) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + shoulda-matchers (3.1.3) + activesupport (>= 4.0.0) + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.2) + spree_extension (0.0.9) + activerecord (>= 4.2) + spree_core + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + state_machines (0.5.0) + state_machines-activemodel (0.7.1) + activemodel (>= 4.1) + state_machines (>= 0.5.0) + state_machines-activerecord (0.6.0) + activerecord (>= 4.1) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + twitter_cldr (5.4.0) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.7) + thread_safe (~> 0.1) + warden (1.2.8) + rack (>= 2.0.6) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + byebug + capybara + coffee-rails + database_cleaner + factory_girl_rails + ffaker + launchy + poltergeist + pry + rails-controller-testing + rspec-activemodel-mocks + rspec-rails (~> 3.5.0) + sass-rails + selenium-webdriver + shoulda-matchers (~> 3.1) + simplecov + spree! + spree_admin_roles_and_access! + spree_auth_devise! + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/lib/spree/permissions.rb b/lib/spree/permissions.rb index f214d75..c13fdac 100644 --- a/lib/spree/permissions.rb +++ b/lib/spree/permissions.rb @@ -25,11 +25,11 @@ def method_missing(name, *args, &block) current_ability.can :create, Spree::Order current_ability.can :read, Spree::Order, [] do |order, token| - order.user == user || (order.guest_token && token == order.guest_token) + order.user == user || (order_token(order) && token == order_token(order)) end current_ability.can :update, Spree::Order do |order, token| - !order.completed? && (order.user == user || order.guest_token && token == order.guest_token) + !order.completed? && (order.user == user || order_token(order) && token == order_token(order)) end current_ability.can :read, Spree::Address do |address| @@ -75,5 +75,9 @@ def find_action_and_subject(name) return can.to_sym, action.to_sym, subject, attribute.try(:to_sym) end end + + def order_token(order) + order.respond_to?(:token) ? order.token : order.guest_token + end end end diff --git a/lib/spree_admin_roles_and_access/engine.rb b/lib/spree_admin_roles_and_access/engine.rb index 8bb91d0..bf32408 100644 --- a/lib/spree_admin_roles_and_access/engine.rb +++ b/lib/spree_admin_roles_and_access/engine.rb @@ -2,9 +2,10 @@ module SpreeAdminRolesAndAccess class Engine < Rails::Engine require 'spree/core' isolate_namespace Spree + isolate_namespace SpreeAdminRolesAndAccess engine_name 'spree_admin_roles_and_access' - config.autoload_paths += %W(#{config.root}/lib) + config.autoload_paths += %W(#{config.root}/lib #{config.root}/app) # use rspec for tests config.generators do |g| diff --git a/spree_admin_roles_and_access.gemspec b/spree_admin_roles_and_access.gemspec index 3cc1032..38f8a0c 100644 --- a/spree_admin_roles_and_access.gemspec +++ b/spree_admin_roles_and_access.gemspec @@ -14,11 +14,13 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.requirements << 'none' - spree_version = '>= 3.2.0', '< 4.0.0' + spree_version = '>= 3.7.0', '< 5.0.0' s.add_dependency 'spree_core', spree_version s.add_dependency 'spree_auth_devise' + s.add_development_dependency 'spree', spree_version + s.add_development_dependency 'spree_auth_devise' s.add_development_dependency 'capybara' s.add_development_dependency 'ffaker' s.add_development_dependency 'rspec-rails', '~> 3.5.0'