Click here to Skip to main content
11,709,220 members (49,259 online)
Rate this: bad
Please Sign up or sign in to vote.
I am having data having different role band like Manager,emplyee . Depend on role i want to give access to aspx page..if access is given to manager and when employee went to that page it must show access denied...Also i can change the role dynamically like employee to manager and then he gone to that page he get access..

role data is in database...

plz help me out... Thank you !!
Posted 1-Feb-13 18:36pm
Edited 1-Feb-13 18:37pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

first you create roll,employee and role_access and roll_employee_Map table.
then you make the class and set your logic in BLL.
and if you want to change role of employee then then just change the roll of employee and reflect it into roll_employee_Map table.
Bhaskar Dhone at 2-Feb-13 1:21am
that is ok....but how to restrict page access depend on that..
Tanumay99 at 2-Feb-13 1:43am
you map that access specification pages into role_access table
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

This is a general scenario. And ASP.NET has built-in solution for that, called role based authentication. To use that, you need to use one of the authentication methods supplied with[^]: form based or window based (you could make your own, but that would be complicated). By default the windows based is using the windows identity as authentication basis, and windows group memberships as role memberships. The form based has more options, but as you tagged your question with sql server too, I suppose you want to store your users and role information in the database. Well, that is also ready-to-use. Here you have two comprehensive articles:[^] and[^]
Of course, you can extend these features, replace providers and so on - but these are advanced tasks, so I suggest you start with the built-in ones.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Can you give me the sample code for setting the permission

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 580
1 OriginalGriff 250
2 Maciej Los 225
3 Peter Leow 219
4 Mika Wendelius 160
0 OriginalGriff 9,428
1 Sergey Alexandrovich Kryukov 9,027
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100