at.
at.

Reputation: 52540

Authorization supported in Devise for Rails?

I've implemented Devise for a Rails 3.2.8 app. Very easy, seems to work fine. But the documentation suggests creating a whole separate table with email/passwords for an admin role. I need admins in our system to also be treated like users, they just have extra permissions. Does Devise help in this or are there good extensions for authorization? Or am I expected to create an additional Role model or field in the User model to deal with this?

Upvotes: 1

Views: 1114

Answers (1)

inntran
inntran

Reputation: 1033

If your requirements are simple, you may just add a boolean column in your users table called "is_admin" and check against it everytime you need extra permissions.

For a systematic solution, check out Cancan by ryanb(Railscasts author)

Upvotes: 3

Related Questions