ASP.NET security control

P

PK

Hi All,

I will be writing an asp.net application which require users to log on
before they can view the particular information.
so here the security control is needed and a must for different user who
have various access level.

I am wondering what is the best way or a more reliable way to control the
user ?
my backend using SQL server.

thank you.
 
W

William F. Robertson, Jr.

I have a three objects that assist my team in doing exactly that.

I have a SecurityProvider, Page, SecurityHandler.

The SecurityHandler is an abstract class that holds IsSecurityValid,
CanViewPage, RedirectOnFailure, BuildSecurity. The class derived for each
application must implement these methods.

When my Page object is loading, it looks through the SecurityProvider
(mostly static methods) to see if a SecurityHandler was initialized for the
project (on application start), if it was, it will call IsSecurityValid (if
failure, call BuildSecurity, if failure call RedirectOnFailure), if the
security information is valid, it will call CanViewPage, passing the current
page name for the current request. ( if failure, it calls redirect on
failure ).

Now the SecurityHandler stores a table of pagename, security, and special
permissions that the page object exposes through its Security property (if
the handler was initialized otherwise an exception is thrown). The page
developers can also request special permission for pages ( such as can this
user view change infromation on the page.) The Security property also
stores (as defined in the BuildSecurity method) data on the specific
session, such as name, group, role, etc.. that can be easily accessed at the
page level.

The security for all our apps are driven by Sql and loaded once during page
information.

HTH,

bill
 
P

PK

Could you send some sample application for me ?


William F. Robertson said:
I have a three objects that assist my team in doing exactly that.

I have a SecurityProvider, Page, SecurityHandler.

The SecurityHandler is an abstract class that holds IsSecurityValid,
CanViewPage, RedirectOnFailure, BuildSecurity. The class derived for each
application must implement these methods.

When my Page object is loading, it looks through the SecurityProvider
(mostly static methods) to see if a SecurityHandler was initialized for the
project (on application start), if it was, it will call IsSecurityValid (if
failure, call BuildSecurity, if failure call RedirectOnFailure), if the
security information is valid, it will call CanViewPage, passing the current
page name for the current request. ( if failure, it calls redirect on
failure ).

Now the SecurityHandler stores a table of pagename, security, and special
permissions that the page object exposes through its Security property (if
the handler was initialized otherwise an exception is thrown). The page
developers can also request special permission for pages ( such as can this
user view change infromation on the page.) The Security property also
stores (as defined in the BuildSecurity method) data on the specific
session, such as name, group, role, etc.. that can be easily accessed at the
page level.

The security for all our apps are driven by Sql and loaded once during page
information.

HTH,

bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top