MVC role-based permission control--Database design

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.