Allowing all enterprise users to access products

This commit is contained in:
Rob Harrington
2014-09-26 14:52:45 +10:00
parent 2ea0c89899
commit 299b0fe5be
2 changed files with 3 additions and 2 deletions

View File

@@ -19,7 +19,8 @@ class AbilityDecorator
def can_manage_products?(user)
( user.enterprises.map(&:type) & %w(single full) ).any?
# ( user.enterprises.map(&:type) & %w(single full) ).any?
can_manage_enterprises? user
end

View File

@@ -44,7 +44,7 @@ module Spree
it "can't when a user manages a 'profile' type enterprise" do
user.enterprise_roles.create! enterprise: enterprise_profile
subject.can_manage_products?(user).should be_false
subject.can_manage_products?(user).should be_true
end
it "can't when the user manages no enterprises" do