1
2 Comments

Best practice for User-management in an enterprise application

What’s the best practice for user management in an enterprise application? I want to achieve a very flexible user management experience where I can add individual model validations to each user without it affecting other users and where a user can switch say from an admin to a normal user and vice versa without much stress.

I am of the thought of using a single user table for this and then associate a roles table to the user table, but I don’t think this will allow me apply individual validations to each kind of user.

On the other hand, I want to create individual user tables, say, admin table and user tables and then also create a roles tables and asssociate to each table.

Can I get some direction on which will help me achieve my goals without much performance issues , but with great flexibility. Thank you.

As a note the application is been built using Ruby on Rails.

on December 4, 2020
  1. 1

    You have a user table
    You have a permissions table (admin, read, write, read only X, write only Y)
    and you have table user_permissions
    With that you can apply permissions to users.
    But that is just a very rough idea, you have to iterate whether it fits with your product.