Ruby on Rails Thursday, February 23, 2017

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

On Thu, Feb 23, 2017 at 9:36 AM Frederick Cheung <frederick.cheung@gmail.com> wrote:

On Wednesday, February 22, 2017 at 6:19:18 PM UTC, Mike wrote:
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.

Fred

Fred, it is an important point, though. App needs vary, types of user models vary, and can have this sort of bifurcated user/admin concept with separate models and *also* need permissions / roles, which could be different for the two types of user.

There are other ways to approach it as well, such as have an account model, which handles both user and admin users, and have other tables that deal with particular other fields and aspects of each user.

It's important to spend time to think through some of these, and not just land on one and always stick with it. You also don't want to paint yourself into a corner if (when?) you later find what you thought you knew changes.

Great points, Fred.
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t__Po6tuFEsJopNYgGW1YYH8r0veVJM3PUEFcg%3DHxnY6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment