CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 12/16/2007 5:34:13 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 7 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
8 Items, 1 Pages 1 |< << Go >> >|
rajesh466
Asp.Net User
Assigning users in the database to restrict access to webpages12/16/2007 5:34:13 AM

0/0

  I had created  a small intranet application . Here the new user should register before he needs access to the application. Once registered, all the details of him are stored into the database.   Once the user  enter the username and password, it checks in the database whether the user exists or not. As in my case, there are users with three roles : admin, manager and supervisor and I indicated the same in the database. Thats fine and I am able to do it till here . How is it possible to restrict users to view specific pages ? I think , it is possible by using ASP .Net configuration tool(Assigning roles),  but by using it we should create users again and assign roles to them . Right ?  Isn't it possible for the Configuration tool to refer for the users in the database and based on the role he is assigned  give access to specific webpage ?

 I am in urgent need of this  .

hkhaled
Asp.Net User
Re: Assigning users in the database to restrict access to webpages12/16/2007 6:56:09 AM

0/0

Hi,

You can use these tags in your web.config file:

<location path="adminpage.aspx">

<system.web>

<authorization>

<allow roles="Administrators"/>

<deny users="*"/>

</authorization>

</system.web>

</location>
 

thanks

 


sharp guy
Stoian Bucovich
Asp.Net User
Re: Assigning users in the database to restrict access to webpages12/16/2007 7:02:10 AM

0/0

Hi,

you can put in page load event handler for admin pages this

If User.IsInRole("manager") or User.IsInRole("supervisor")  Then

Response.Redirect("default.aspx")

End If

that way you will restrict from view admin pages all users that belong to manager or supervisors group

Hope it helps

 

Regards

--------------------------------------------------------------------------

Please do not forget to mark as "Answered" the correct answer. Thanks

rajesh466
Asp.Net User
Re: Assigning users in the database to restrict access to webpages12/16/2007 2:29:38 PM

0/0

Hey Bucovich,

                   I am not using any membership controls in this application. I am  following in a traditional approach.  I am not using this ASP .Net configuraion tool for creating / managing users or roles at any point.  Everything should be done by using database because my application supports hundreds of users and it is difficult to create each user with the help of config tool.

              So , Can u please help me or  post any links related to this context. GeekedGeeked

rajesh466
Asp.Net User
Re: Assigning users in the database to restrict access to webpages12/16/2007 3:40:46 PM

0/0

Hey Bucovich,

                   I am not using any membership controls in this application. I am  following in a traditional approach.  I am not using this ASP .Net configuraion tool for creating / managing users or roles at any point.  Everything should be done by using database because my application supports hundreds of users and it is difficult to create each user with the help of config tool.

              So , Can u please help me or  post any links related to this context. GeekedGeeked

thukralz
Asp.Net User
Re: Assigning users in the database to restrict access to webpages12/17/2007 4:19:06 AM

0/0

When user logs in, you can create a cookie with there Username and say "Admin" or "Manager" in there. On page load if the page is only for "Manager"

Check for that in cookie and grant access if its Manager, otherwise redirect with some message.

You can use .NET inbuilt Forms Authentication to achieve it.

izeman
Asp.Net User
Re: Assigning users in the database to restrict access to webpages12/17/2007 11:10:32 AM

0/0

 You can customize asp.net mempership and roles to your own needs. There you have all the functionality you need.

This links helped me a lot the first time:

http://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication_2C00_-and-Security-Resources-.aspx

http://msdn2.microsoft.com/en-us/library/f1kyba5e.aspx#Mtps_DropDownFilterText

http://msdn2.microsoft.com/en-us/library/f1kyba5e.aspx#Mtps_DropDownFilterText

takes some time to read but it's usefull.  

hkhaled
Asp.Net User
Re: Assigning users in the database to restrict access to webpages12/17/2007 12:12:29 PM

0/0

 HI,

You can use form Authentication for this if you dont want to use ASP.NET 2 Builtin controls.

check out this post for form authentication:

http://msdn2.microsoft.com/en-us/library/aa302399.aspx 

 
as its mentioned in the previous post, the Login controls which comes with ASP.NET 2.0 are fully customizable which are time saving if you want.

thanks

 


sharp guy
8 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Dreamweaver MX 2004 Savvy: Christian Crumlish, Lucinda Dykes Authors: Christian Crumlish, Lucinda Dykes, Pages: 670, Published: 2004
Beginning Dreamweaver MX 2004 Authors: Charles E. Brown, Imar Spaanjaars, Todd Marks, Pages: 792, Published: 2004
Macromedia Dreamweaver MX Advanced for Windows and Macintosh: Visual Quickpro Guide Authors: J. Tarin Towers, Abie Hadjitarkhani, Sasha Magee, Pages: 490, Published: 2002
Multimedia Encryption and Authentication Techniques and Applications Authors: Borivoje Furht, Darko Kirovski, Pages: 395, Published: 2006
Multimedia Security Handbook Authors: Borivoje Furht, Darko Kirovski, Pages: 815, Published: 2005
JavaServer Pages Authors: Hans Bergsten, Pages: 740, Published: 2003
PHP & MySQL Web Development All-in-One Desk Reference For Dummies: All-in-one Desk Reference for Dummies. Authors: Janet Valade, Tricia Ballad, Bill Ballad, Pages: 646, Published: 2007
ASP.NET 2.0 Instant Results Authors: Imar Spaanjaars, Paul Wilton, Shawn Livermore, Pages: 456, Published: 2006
Oracle Application Server 10g Web Development: Build and Deploy Web-Based Applications in the Oracle Environment Authors: Chris Ostrowski, Bradley D. Brown, Pages: 747, Published: 2004
MySQL and Perl for the Web Authors: Paul DuBois, Pages: 529, Published: 2001

Web:
How can I restrict web access so users can't view sites unrelated ... MyCompany Toolbox also gives you the power to restrict access by assigning new users roles and user groups. Administrators have full control over who can ...
Controling users access - ng.asp-net-forum.security - fix error ... Controling users access, > ROOT > NEWSGROUP > Asp.Net Forum ... integrate tidy into vs2005? assigning users in the database to restrict access to webpages . ...
How do I use passwords to restrict access to a directory? (UNIX) You can assign one or more unique user IDs and passwords to a site directory. This allows you to restrict access to the resources in the protected directory ...
User registration and authentication for an ASP.NET 2.0 webs The user information in such instances will be retained in the database, but the user will not be able to access the web pages of your application. ...
How can I restrict access to my webpage? DataHabitat allows you to assign certain rights to users regarding data access and .... First you can restrict access with a Windows 2000 user account and ...
Information Technology Services: Web Services To restrict access to the files in your web directory, ... The passwords that you assign your users (or that they give themselves) should therefore not be ...
Securing Roles By assigning users to roles, you can control access to different parts or ... database roles and views that enable you to restrict user access to only the ...
From the Princeton University Help Desk Knowledge Base Web publishing: How to restrict public_html web pages using htaccess. Synopsis: ... Restrict access to specific Princeton and/or non-Princeton users ...
Using the filters Now assign the no access attribute to this filter for all users whose access to these files you want restrict:. If you want yourself to be able to run ...
PHP User Management Script and Programs :: Hot Scripts Assign users to multiple secure areas. - Manage unlimited registration ... You can easily restrict access to any web page by users only and access level. ...

Videos:
A New Way to look at Networking Google Tech Talks August 30, 2006 Van Jacobson is a Research Fellow at PARC. Prior to that he was Chief Scientist and co-founder of Packet Design. P...




Search This Site:










remotely printing word document using asp.net & c#

switching from classic asp to asp.net

classificatory module

scope of static variables

weird banner module behavior

definition

dnn install problem

javascript onclick event

how to remove a "module on all pages?"

problem with custom list control

how can i make intellisense work in my codebehind file in vs 2005 for my controls?

radiobuttonlist problem

pattern matching problem

ajax control toolkit ans vwd 2008 express problems

solpart menu - css support for current tab ?

code security

hyperlink(ing) from vb code behind

what type of windows to use?

treeview, how to set background of expanded items?

module development (controls like dnn:label)

async webrequest not firing callback

how to modify dnn modules sitewide?

private messages 1.01

error while calling a function

destroying objects in asp.net

using an apple

can not open asp pages using ie6

tree view control & web.sitemap - problem - ( plz help... its really urgent...)

is there any problem with this querystring!!

help regarding video chat

 
All Times Are GMT