Implementation Code of ASP. NET general permission verification,

Source: Internet
Author: User
Tags constant definition

Implementation Code of ASP. NET general permission verification,

This article introduces the implementation code of general permission verification, which includes importing parameters, parsing XML, processing according to XML configuration, and returning results.
Code Architecture


I. Class Introduction

1. SFWebPermission: implements the IHttpModule interface and permission verification portal;
2. SFConfig: Import XML configuration class;
3. SFPermission: Parse 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 constant definition class;
9. SFPermission. xml: configuration file. The format has been described in the previous article.
Ii. code structure
Figure 1

Figure 2

The Algorithm Implementation of the code is the easiest to think of and the most commonly used encoding method. The advanced usage in the language has never been studied. It is certainly not used!
Permission verification is based on the primary key obtained through URL query. Therefore, the permission Project (menu) Table must have a URL column. We recommend that you add a corresponding table, assume that a permission item may need to correspond to multiple URL requests.
Using this component does not require any code modifications to the original project.
The code is developed under the. net2.0 framework and needs to be tested under the bin directory of the website;
Add

If an error occurs, add the following content under the <system. webServer> node.

<modules><add name="myHttpModule" type="SFPermission.SFWebPermission,SFPermission"/></modules>

The above is the implementation code of ASP. NET general permission verification. I hope it will be helpful for you to learn.

Articles you may be interested in:
  • Asp.net FCKEditor 2.6.3 you are not authorized to upload files. solution:
  • Asp.net Forms authentication and role-based access
  • Instance description simple role permission control in asp.net
  • A permission Scheme Based on Asp. Net MVC
  • Simple and efficient permission design example implemented by asp.net + sqlserver
  • Asp.net BasePage class + Session General user logon permission Control
  • Set IIS permissions for ASP. NET Word operations
  • Asp.net Mvc authentication, exception handling, permission verification (interceptor) implementation code
  • ASP. NET.4.5.1 + MVC5.0 set system roles and permissions (1)

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.