Unable to access model using cancan gem in rails -
i using spree build e-commerce application.i have created 1 model offer(spree::offer) . have created 1 role seller,and trying give seller access view,update , manage model(offer) in admin panel using following code
if user.respond_to?(:has_spree_role?) , user.has_spree_role?('supplier') > can :manage,offer
but when login seller,i unable see offers tab in admin panel but,when login admin ,i able see offers tab.admin has following access
can :manage,:all
i new rails, should prior, desired result
you need define ability offer model under spree module , can access spree::offer recourse.
if user.respond_to?(:has_spree_role?) , user.has_spree_role?('supplier') can :manage, spree::offer end
Comments
Post a Comment