Asp. NET Universal permission verification Implementation Code Ideas _ practical skills

Source: Internet
Author: User

This paper introduces the implementation code of universal permission authentication, which is divided into import parameters, parsing XML, processing according to XML configuration, and returning results.
Code architecture diagram


First, Class introduction

1.SFWebPermission: Implement IHttpModule interface, access authentication;
2.SFConfig: Import XML Configuration class;
3.SFPermission: Parsing XML configuration for permission verification;
4.SFAccessOper: Database operation class;
5.sfpermissionsql:xml node entity class;
6.sfparameter:xml node entity class;
7.SFCommon: System variable definition class;
8.SFConst: System constants Definition class;
9.sfpermission.xml: Configuration file, which has been introduced in a format.
Second, the code structure
Figure 1

Figure 2

Code algorithm implementation is the most easily thought, the most commonly used encoding methods, the language of the more advanced usage is really not how to study, certainly is not used!
Permission validation is through the URL query to determine the primary key, so the permission entries (menu) table to have a URL column, it is recommended to add a corresponding table, as a permission entry may need to correspond to multiple URL requests.
You do not need to make any code modifications to the original project using this component.
The code is developed under the. net2.0 framework and needs to be tested in the bin directory of the Web site;
Add under the Web.config <system.web> node

 
 

If this adds an error, then add the following <system.webServer> node

<modules>
<add name= "Myhttpmodule" type= "sfpermission.sfwebpermission,sfpermission"/>
</ Modules>

The above is about ASP.net universal authorization to implement code ideas, I hope to help you learn.

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.