Pergunta

I have been following 2 separate tutorials to build a rails 3 app each of which covers modelling users. however they don't cover segregating users into groups. specifically im trying to create a users model where one group of users (consumers) would be limited to browsing, making purchases updating their own accounts when logged in, and a 2nd group (admins) would be able to add and maintain products and update their own accounts and possibly create other accounts to manage their products. any assistance on how to pull this off would be much appreciated.

Foi útil?

Solução

This sort of thing is called roles (admins, consumers) and authorization (purchasing, updating). Gems are available which can help you with both.

I use CanCan for the authorization and make my own roles table. I'd recommend looking at Rubytoolbox to find out what your options are: https://www.ruby-toolbox.com/categories/rails_authorization

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top