You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used CanCanCan to limit specific action on admin dashboard based on role. I would like to limit some specific CRUD operations on specific model. Is it possible to also render different content on specific role? I have specified ability.rb with for example:
user can :read, Company, id: user.companies.pluck(:id)
and connect load_and_authorized_resource in controller.rb.
When I have used command Company.accessible_by(ability) in IRB it give me correct feedback. But how can I connect this functionality to Trestle?
The text was updated successfully, but these errors were encountered:
I have used CanCanCan to limit specific action on admin dashboard based on role. I would like to limit some specific CRUD operations on specific model. Is it possible to also render different content on specific role? I have specified ability.rb with for example:
user can :read, Company, id: user.companies.pluck(:id)
and connect load_and_authorized_resource in controller.rb.
When I have used command
Company.accessible_by(ability)
in IRB it give me correct feedback. But how can I connect this functionality to Trestle?The text was updated successfully, but these errors were encountered: