ASP. net mvc + EF framework + EasyUI permission management series (21)-basic implementation of User Role Permissions

Source: Internet
Author: User

ASP. net mvc + EF framework + EasyUI permission management series

  (Opening)(1): Framework Construction(2): database access layer design Demo(3): interface-Oriented Programming(4): encapsulation of the business logic layer 

(5): Jquery easyUI implementation at the front end(6): EF context instance Management(7): DBSession Encapsulation(8): unique in the DBSession thread  

(9): Learning TT touch Edition(10): VSS source code management (11): verification code implementation and underlying Modification(12): Implement Asynchronous User Login and T4 templates

(13) Permission Design(14): Build the main framework(15): the permission database model and user logon details are incorrect.(16) user registration verification

(17) details of the user registration function(18): Use of filters and batch deletion of data (pseudo-deletion and direct deletion)

(19): Modify and browse user information(20) Implementation of Multi-condition fuzzy query and recycle bin Restoration

In the previous blog, we finally completed all the operations on the user. I was not going to write this blog, but because of the role and permission information, so I will briefly talk about the role and permission design ideas. As for code and implementation, I will not talk about it, because it has already been very detailed in the user, next, let's briefly introduce the content of this blog.

1. User implementation

(1) We have spent several blogs and introduced the implementation of users. Here, I put these three relationships in one to show their interfaces. the user-Implemented interfaces are as follows:

(2) At the beginning, we only need to add, delete, modify, and query users. In the future, we will also set roles and permissions for users, we will continue to talk about this later.

(3) In the current Code, various queries are relatively compact, and the recycle bin is not well-developed. It will be changed in later versions or in time.

2. Role Implementation

(1) The implementation of a role is basically the same as that of a user. It implements some addition, deletion, modification, and query functions and allows the role to set permissions. We will discuss this later.

(2) In a role, the current role type is writable, that is, only common roles, special roles, and VIP senior members are allowed, therefore, in the subsequent changes, we will set the role type to be read from the database, and the Role type we store in the database now is the mark (, 2), not the Chinese character, this is to prepare a database for extraction.

(2) Implementation of the final role:

3. Permission implementation

(1) The implementation of permissions is basically the same as that of roles and users. We will introduce the main idea.

(2) The most important data in the permission table is the permission name, request method, and request path, this is because this method is used to determine which user has permissions.

(3) In the Request Method in our permission table, the database still reads the mark (), corresponding to HTTPGET and HTTPPOST, which may be moved later, so set aside his interface earlier.

(4) Permission implementation:

. NET developer blog: www.kencery.com

Kencery returns to the beginning of this series

Related Article

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.