are admins also users?

i want one of my tables to belong to either admins or users because i’m under the impression they can’t belong to both can someone clarify please

You need to give us more information about the tables and classes involved and what you are trying to achieve.


I never really liked this functionality of devise,.

I normally make everyone a user, and the assign an 'admin' role in the same way as any other permission.

:thumbs-up: for this. Users (aka accounts) are users. Roles (aka privileges) are roles. Users have roles. Roles define access to resources and actions.

I agree, so then what do we need admin model for in light of roles

I agree, so then what do we need admin model for in light of roles

You don't need admin model

If you have a robust permissions system, you can also hide or show fields based on those permissions

In short I would never use an 'admin' model there is simply no point for 99% of applications

I’ve had a different experience - in one of the apps I work on I regret that users and admins are differentiated only by role. users have attributes that admin’s don’t need for admin tasks, but validations there mean that admins need to go though that signup process, rather than just email address & password. There are some attributes that only admins need so you end up with columns that are null for 1 million record and set for 5 of them. In general I’d quite like the admin components and consumer facing components to be separate web applications & the shared user accounts are one of the things binding them at the moment.

I can see that it’s probably not a common case though.


Apologies if this comes through twice, it seems to have gotten stuck on my phone.

Fred, it is an important point, though. App needs vary, types of user models might vary, and you can have this sort of bifurcated user / admin concept and still need them to have roles.

Even with this, you could have an account model, with roles of user and admin, maybe other levels, and split theextra info needed for users into a separate model, too.

App needs vary, user needs vary, it’s important to examine it well enough not to paint yourself into a corner in case what you thought you knew changes.