ASP. net mvc + EF framework + easyui implement permission management (with source code)

Source: Internet
Author: User

It's very short. It's almost time for the Spring Festival. During this period, my blog is not updated, so let's write a project today, is the basic operation on permissions,CodeIn this case, upload the source code and image display directly. Next we will go to the topic to introduce this project and some technical points:

1. technologies used in the project

(1) Front-end Presentation: ASP. net mvc 3.0 + jquery easyui + jquery

(2) Development Environment: vs2012

(3) Database: SQL Server 2012

(4) code management: SVN

(5) technologies used: ASP. net mvc, EF framework, jquery easyui, log4net, VSS, and Microsoft T4 templates

(6) The database script is in the app_data folder of the project and can be automatically generated by executing the EF framework.

2. General system background permission management

(1) What is a permission? In e-commerce and other information systems, any operation requires permission verification. If there is access permission, the user is allowed to continue the access. If not, the request is terminated, permissions are used for classification and security consideration.

(2) Permission management: Generally, users can access and can only access their authorized resources according to the security rules or security policies set by the system.

(3) user and action-based permission management

(4) Role-based and action-based permission management

(5) group-based, role, action, and user permission management.

3. Create a permission business model

(1) Use the edmx designer of the EF framework to design database implementation.

(2) Notes:

1) Use modelfirst to complete database design

2) If the guid type is used for the primary key, automatic growth must be removed.

3) remarks must be set for all properties of an object.

4) The length of the string must be set for the string type of the object.

5) The naming rules must meet the requirements.

6) Model Design Discussion and review

(3) Permission EF framework model settings:

4. The following shows the functions of the project.

(1) first, use the username and password to log on to the admin account. This is a management that has no authentication permission in the code, that is, when you use this user name and password to log in, all permissions are accessible.

(2) logon page ::

(3) display the admin logon result,

(4) Then we register a user,

(5) then, when we use the user just logged on to the system, the access will be blank ,:

(6) We can set permissions and roles for users, and set user roles and special permissions on them. We have set super administrator roles for hjl users ,:

(7) we are using hjl to log on ,:

(8) Why is there no data in permission management? This is because this user does not have the permission to view the data. If you want to display the data, you need to set the permission. I will not set it here.

5. display the entire website layout:

Request source code on www.kencery.com

KenceryReturn 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.