From a2b612e7230c5679208b0d140ec21acf8029cbd5 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 5 Aug 2013 15:21:20 +1000 Subject: [PATCH] Add clone and destroy product access for enterprise users --- app/models/spree/ability_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/ability_decorator.rb b/app/models/spree/ability_decorator.rb index 3d10e81923..11732192d9 100644 --- a/app/models/spree/ability_decorator.rb +++ b/app/models/spree/ability_decorator.rb @@ -3,7 +3,7 @@ class AbilityDecorator include CanCan::Ability def initialize(user) if user.enterprises.count > 0 - can [:admin, :read, :update, :bulk_edit], Spree::Product do |product| + can [:admin, :read, :update, :bulk_edit, :clone, :destroy], Spree::Product do |product| user.enterprises.include? product.supplier end