Click here to Skip to main content
Rate this: bad
good
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 19:36pm
Edited 1-Feb-13 19:37pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hi
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.
  Permalink  
Comments
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
good
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 asp.net[^]: 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: http://chrisfulstow.com/installing-asp-net-membership-roles-and-profiles-support-in-sql-server[^] and http://www.asp.net/web-forms/tutorials/security/roles/role-based-authorization-cs[^]
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.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Can you give me the sample code for setting the permission
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 295
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2014
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