I am using spree_drop_ship as an extension to build my application.
Does spree provide an interface for the supplier to login and see what his products,orders, or shipments are?
I have checked in Supplier controller there was no index function defined.
Taking inputs from the answer i linked in the comments , your code would be something like this
class SupplierAbility
include CanCan::Ability
def initialize(user)
user ||= User.new
if user.has_role? "supplier"
can :read, Product
end
end
end
And ofcourse adding this to spree.rb initializer ,
Ability.register_ability(SupplierAbility)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With