mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
Add clone and destroy product access for enterprise users
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user