Is there a privilege based authorization gem or a known working convention how to do it for rails?

I am making an app which will have two types of priviledges for users, granting them create, update and delete rights for two types of entities: tournaments and clubs.

I want to be able to select that users u1, u2, u3 can edit tournamet t3, and u3, and u5 can manage club c3, u2 and u4 club c4 etc.

Currently for each entity I have a table associating user id and entity id which the user can modify, but it feels hacky.

Is there any gem that would do it for me, or any tutorial or app example doing somthing like that correctly?