Page Filter in C#

A

Andy Le

Your opinion is appreciated.

I am thinking about building a role-based security module for my web
based application. Here is what I have in mind:

1. Build a page filter class which enherits from IHttpModule and
overide the Stream.Write() method....to basically remove the
restricted html elements based on the user's role before the html
comes back to the browser. Any defects in this design or do you see
any other better approaches ?

Thanks
 
R

Romualdas

Hi,

You have mentioned you are implementing role based
security. Roles are often responsible for working with
certain business entities that could be displayed in
UserControl (for caching, UI process, etc.).

So another possible approach in such case could be to
develop some attribute and apply it to class inherited
from UserControl, which would simply handle the display
according the attribute parameters such as groups, users
and display mode (hide or disable controls).
The benefits in this case:
- Easy to create;
- Simple attribute based programming later;
- All the benefits from the UserControl;
- And one more - the ViewState will have everything as it
should have. Just by removing HTML elements you'll have to
be carefull about this;
Drawbacks:
- Not sure, but probably streams could be a bit faster;

Romualdas

-----Original Message-----
Your opinion is appreciated.

I am thinking about building a role-based security module
for my web based application. any other better
approaches ?
 
R

Romualdas

Just thought,

maybe dynamically loading different UserControls could be
enough (see IBuySpy portal)?

Romualdas
 
R

romualdas

another idea,

maybe it would be sufficient to load user controls
dynamically (like in IBuySpy)?

Romualdas
 

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
474,082
Messages
2,570,589
Members
47,211
Latest member
Shamestone

Latest Threads

Top