Hi I tried to add a product in spree using the supplier login. I have two gems related to spree marketplace installed
gem 'spree_drop_ship', github: 'spree-contrib/spree_drop_ship', branch: '3-0-stable'
gem 'spree_marketplace', github: 'firman/spree_marketplace'
Also, I updated my ability decorator to provide related authority using
if user.has_spree_role? "supplier"
can [:admin, :manage, :index, :create, :update], Spree::Product do |product|
product.supplier_ids.include?(user.supplier_id)
end
end
I can see the form to add the product but when I add basic product details and click on create, it give me Authorization Failure
error
Please suggest what should I do to resolve the issue.
Update: I debugged the app and found there was some migration files missing, when I migrated db, I could see the supplier_id column in spree_products, but when I added new product using the supplier login, same error was being thrown as unauthorized, I checked with database the supplier_id column was NULL
.
Where should I make changes so that correct supplier id is stored in spree_products