In the background of the site design process will encounter permissions control this problem
Currently the more popular solution is role-based rights management
The basic ideas are as follows
Set up user Information table, role information table, permission information table respectively
Let the user and the Role Association, the role and the Permission association, when the user accesses, obtains the role information through the user information, then obtains the permission information through the role information, looks up the current user access path the permission ID, then obtains the user right to have the current access permission
Database design:
User table information Role Information table permission information table
Similar roles, we can also design the department table, the company table and so on
Here's how the EF framework works with Modelfirst:
Make many-to-many connections between users and roles, roles, and permissions, users, and permissions, and the Modefirst mode automatically creates intermediate tables and then automatically creates foreign key relationships based on navigation properties
Users can also create their own intermediate tables, and then build a 1-to-many relationship with both sides
MVC role-based permission control--Database design