Building an index page for a supplier using Spree in rails
2 answers
Taking inputs from the answer 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 of course by adding this to the spree.rb initializer,
Ability.register_ability(SupplierAbility)
+2
source to share