In my rails application, my Users have many Projects through Participants.
Currently I am using CanCan for authorizations. I have done some research and can't quite figure out how to do the following.
In my ability.rb file I want to provide :manage abilities to to Users on Projects. Currently that looks like:
can :manage, Project if user.has_role? :silver
My Participants table has user_id and project_id. How do I only give those manage capabilities to users that are associated with a project via the participants table?