473,651 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page level security with attributes - bad idea?

I've spent a good part of the afternoon searching Google and the newsgroups
for some sort of answer - so I apologize if I'm asking something that has
already been asked and answered.

I'm using ASP.Net 1.1 (unfortunately 2.0 isn't an option right now) and I'm
working on the design of a security framework for other developers in our
organization to use.

We have a handful of different types of users that are contained in an enum
called UserTypes. I'm trying to find a way to specify at a page level what
types of users can view a given page - basically to prevent someone from
authenticating and they typing a url to a place they shouldn't be.

The thought I had today was that it would be really cool if I could define a
custom attribute that used our UserTypes enum to let developers easily tag
each page with the allowed user types. I thought that I could then write
"something" (HTTP Handler, Module, etc) to pull the user out of the Context,
interrogate the page being requested for it's attribute and then send the
user to their home page if the request is invalid.

The problem I'm having is figuring out how to write that "something" - a
Module doesn't seem like it's going to work because it sits in the stream
before the handler for Page is even created. I'm thinking a module might
work, but I'm not sure how to pull that off, and, I'm not sure that I want
to load the page twice.

So... if anyone can give me a nudge in the right direction, I would really
appreciate it. Or - if someone has a better idea on how to accomplish what
I'm trying to do, that would be cool too. Is this a bad idea?

Thanks in advance,

Nathan
Dec 30 '05 #1
2 2034
Nathan:

You can create a module that hooks the PreRequestExecu teHandler. The
runtime will have created the Page by this point.
http://odetocode.com/Blogs/scott/arc...2/09/2604.aspx

Have you looked at the built-in PrincipalPermis sionAttribute?
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 30 Dec 2005 16:15:07 -0600, "Nathan"
<nratcliff@<REM OVE>gmail.com> wrote:
I've spent a good part of the afternoon searching Google and the newsgroups
for some sort of answer - so I apologize if I'm asking something that has
already been asked and answered.

I'm using ASP.Net 1.1 (unfortunately 2.0 isn't an option right now) and I'm
working on the design of a security framework for other developers in our
organization to use.

We have a handful of different types of users that are contained in an enum
called UserTypes. I'm trying to find a way to specify at a page level what
types of users can view a given page - basically to prevent someone from
authenticati ng and they typing a url to a place they shouldn't be.

The thought I had today was that it would be really cool if I could define a
custom attribute that used our UserTypes enum to let developers easily tag
each page with the allowed user types. I thought that I could then write
"something" (HTTP Handler, Module, etc) to pull the user out of the Context,
interrogate the page being requested for it's attribute and then send the
user to their home page if the request is invalid.

The problem I'm having is figuring out how to write that "something" - a
Module doesn't seem like it's going to work because it sits in the stream
before the handler for Page is even created. I'm thinking a module might
work, but I'm not sure how to pull that off, and, I'm not sure that I want
to load the page twice.

So... if anyone can give me a nudge in the right direction, I would really
appreciate it. Or - if someone has a better idea on how to accomplish what
I'm trying to do, that would be cool too. Is this a bad idea?

Thanks in advance,

Nathan


Jan 1 '06 #2
Thanks Scott -

I did check out the PrincipalPermis sionAttribute - that's pretty much what
spawned my idea. I can't use that attribute because in our scheme, the
roles are not the same as the user types. I'll check out your link and give
that a shot.

Thanks again,

Nathan


"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:15******** *************** *********@4ax.c om...
Nathan:

You can create a module that hooks the PreRequestExecu teHandler. The
runtime will have created the Page by this point.
http://odetocode.com/Blogs/scott/arc...2/09/2604.aspx

Have you looked at the built-in PrincipalPermis sionAttribute?
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 30 Dec 2005 16:15:07 -0600, "Nathan"
<nratcliff@<REM OVE>gmail.com> wrote:
I've spent a good part of the afternoon searching Google and the
newsgroups
for some sort of answer - so I apologize if I'm asking something that has
already been asked and answered.

I'm using ASP.Net 1.1 (unfortunately 2.0 isn't an option right now) and
I'm
working on the design of a security framework for other developers in our
organizatio n to use.

We have a handful of different types of users that are contained in an
enum
called UserTypes. I'm trying to find a way to specify at a page level
what
types of users can view a given page - basically to prevent someone from
authenticatin g and they typing a url to a place they shouldn't be.

The thought I had today was that it would be really cool if I could define
a
custom attribute that used our UserTypes enum to let developers easily tag
each page with the allowed user types. I thought that I could then write
"something" (HTTP Handler, Module, etc) to pull the user out of the
Context,
interrogate the page being requested for it's attribute and then send the
user to their home page if the request is invalid.

The problem I'm having is figuring out how to write that "something" - a
Module doesn't seem like it's going to work because it sits in the stream
before the handler for Page is even created. I'm thinking a module might
work, but I'm not sure how to pull that off, and, I'm not sure that I want
to load the page twice.

So... if anyone can give me a nudge in the right direction, I would really
appreciate it. Or - if someone has a better idea on how to accomplish
what
I'm trying to do, that would be cool too. Is this a bad idea?

Thanks in advance,

Nathan

Jan 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5636
by: robert | last post by:
well, talk about timely. i'm tasked to implement a security feature, and would rather do so in the database than the application code. the application is generally Oracle, but sometimes DB2. Oracle has what it calls package DBMS_RLS, which implements application ignorant row level security. scanning this group yielded "you can't do that; use views". then i dug out DB2Mag qtr 1 2004, and there is MLS for v8/390. from this article,...
13
2132
by: MFS 43 | last post by:
Using Access 2000 and 2002 Have set up user-level security with a new .mdw file (secured.mdw). I open my database with a short cut whose target includes a command line option for the workgroup .mdw file. This seems to work for the user-level security. However, if I go directly (through Explorer) to the Access .mdb file of my program (Program.mdb) and double click to start this .mdb file, the program opens without any security!!
3
3299
by: Br | last post by:
I'm going to go into a fair bit of detail as I'm hoping my methods may be of assistance to anyone else wanting to implement something similar (or totally confusing:) One of systems I've developed has three levels of security. Admins - can see all records Manager - can only see records based on an organisation structure held in a table (simple tree structure) Employee - can only see own records
1
1159
by: localhost | last post by:
I have decorated several classes and methods in an ASP.NET appliation with declarative security attributes for roles. For example: I currently use a Try...Finally block in calling code to test a user's Role permissions. I would like to get away from this and use a real logical construct.
3
3432
by: Dave Wurtz | last post by:
All, Does anyone have ideas how they have implemented field (property) level security? I want to handle this from the business object level, not the database level. Is it best to have a security checking method that gets called in the property and throws an exception? If there are several "fields" that are being accessed multiple times, does it hurt from a performance perspective to have these exceptions thrown all of the time? ...
0
1867
by: accessman2 | last post by:
I have a question. I want to open the MS Access file with user-level Security. I know that if I do NOT setup user-level Security in the MS Access file, and create the table for login in the MS Access file (Put the MS Access file in the server), then it works. I did that. But, I want to know whether or not we can use ASP code to open the MS Access (MS Access user-level Security setting). This way I can put the MS Access file in the public...
2
4030
by: evenlater | last post by:
I realize that user level security is not available for Access databases in the new AK27 format .accdb, and I know that I can still utilize ULS by making my database an .mdb file. But I'm wondering WHY Microsoft is scrapping a feature that I've always found to be extremely useful. Surely they don't expect that users of the new database format will no longer have a need to assign permissions at different levels for different users! Why...
6
2101
by: plaguna | last post by:
Basically I have Three questions about Jet U-L Security: 1.Every time I create new Groups, new Users and Permissions using the User and Group Accounts dialog box, It creates User security for every single DB Access file I have in my system. How can I get a Jet User-Level Security only for the current opened file without using the User-Level Security Wizard?. 2. Also, Is there a way to view and make changes to Groups and Users opening...
2
1856
by: plaguna | last post by:
I have MS Access 2007 (My Database files are saved as .mdb extension). I have no problem to create Users and Groups, and grant them specific Permissions. What I don’t understand is why when I create Password, and Permissions to allow or restrict the access of users and Groups to the objects in a specific Database file, (Ex: for only Sales.mdb) it creates security password for all (*.mdb) files. Some DB files don’t need any type of security...
0
8347
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8792
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8694
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.