search

Home  >  Q&A  >  body text

mysql - table design with multiple roles having different fields

I design a system with multiple roles and they have different fields. Should I design different role tables, or extract a basic information table?
Suppose I extract a basic information table, and I want to design permissions, so I make a role table and use the user role table to associate it. Then, where to put the specific field information of different roles, I need to build the specific fields of different roles. Is the information table then associated to different roles?

滿天的星座滿天的星座2774 days ago787

reply all(2)I'll reply

  • 某草草

    某草草2017-05-19 10:09:01

    In the actual system, the role fields are similar, but the permissions are different. Can we take a step back and think about whether the role definition is reasonable, and then do the database design? There may be a problem with the analysis.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-19 10:09:01

    This is actually a permission management module. Generally, users are placed in one table, permissions are in another table (controllers and methods), and the last user's permissions table is in one table. After the user logs in, just remove its permissions. Methods without permissions are not allowed to be executed.

    reply
    0
  • Cancelreply