Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is it possiable to create an access rule for a file?

Reply
Thread Tools

Is it possiable to create an access rule for a file?

 
 
=?Utf-8?B?QmVha2Vy?=
Guest
Posts: n/a
 
      03-20-2007
I vaguely recall that ASP.NET 1.1 had a way to specify specific pages and
associate required roles to access those pages.. Is there something similar
to that in ASP.NET 2.0? IE, I would like to say that all pages are open,
except x.aspx, y.aspx, and z.aspx. These pages require roles, a,b,c.. Looking
at the allow element, there is no page or related property..??
Sorry if this was already answered..
Thanks for the help..

 
Reply With Quote
 
 
 
 
Jeff T
Guest
Posts: n/a
 
      03-20-2007
On Mar 20, 3:52 pm, Beaker <(E-Mail Removed)> wrote:
> I vaguely recall that ASP.NET 1.1 had a way to specify specific pages and
> associate required roles to access those pages.. Is there something similar
> to that in ASP.NET 2.0? IE, I would like to say that all pages are open,
> except x.aspx, y.aspx, and z.aspx. These pages require roles, a,b,c.. Looking
> at the allow element, there is no page or related property..??
> Sorry if this was already answered..
> Thanks for the help..


In the web.config for a directory or the main one you can setup the
<authorization> part to do what you need.

If you want to restrict a certain page you need to put the
authorization in a <location> section for that page or path.

For example:

<location path="x.aspx">
<system.web>
<authorization>
<allow roles="a,b,c" />
<deny users="*" />
</authorization>
</system.web>
</location>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Many-to-many pattern possiable? Jia Lu Python 4 05-20-2007 07:00 PM
how to add validation rule for url in the validation-rule.xml ,I added some thing like this but......... shailajabtech@gmail.com Java 0 10-12-2006 08:36 AM
Is it possiable? Create object via parameter? Scott Phelps Java 14 09-08-2005 08:39 AM
Re: Is it possiable Raghuram ASP .Net 2 09-05-2005 03:33 AM
Auto messages possiable ? Raghu Raman ASP .Net 4 01-12-2005 11:48 AM



Advertisments