Img source: remino.net
User roles are definitions of what users can do while using
your applications. For example, when you are developing a
marketplace for renting cars, you may need at least two user
roles: hosts, who provide their cars, and users, who rent
cars. Both of these user types will have different functions
that they have at their disposal. Rolify is a Ruby gem that
allows you to easily add and manage user roles in your
application.
It can be integrated with other Ruby gems that you may need
like authentication gems (devise, Authlogic, Clearance) and
authorization gems that don’t provide role classes
(CanCanCan, authority, Pundit).
You can install it as any other Ruby gem, and fortunately,
it comes with a great README
walk-through of the setup procedure and usage that you can
follow along.
As it is an open source project, you can view its source
code, learn how it’s built and also become a contributor to
it.
Click here
to learn more about it.