I am trying to create a web application using ruby on rails. In this application a user has multiple roles like
Ofcourse! you can keep track of current user and then you assign user role when they switch.
If not you can also use rolify gem to add or remove roles and
[cancan] gem for authorization.