mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Allowing all enterprise users to access products
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user