Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

Am working on a college management software in which there are different level users such as Admins, Principals, Teachers. Each users have a different level of privileges. So that all the features are not available to all the users. Users will have their logins.

So my problem is how do i set this access to each features according to their level of privilege...???

Now i do this by checking privilege level at login time and set the feature menu item visible or invisible.

Is their any other best way to implement this....????

Advance Thank You.... :)
Posted
Comments
good.shankar 6-Jun-12 6:57am    
Oh... U all are taking it to a higher level....
I just want to load menu according to the user type. whats the solution for that...

Hi.
Provide your PC with different level of groups (Admins, Principals, Teachers)
Assign appropriate group to your users list.

Then in your project/solution, for each method which must be accessible or restricted for appropriate group write something like that:

C#
[PrincipalPermission(SecurityAction.Demand, Role = @"BUILTIN\Administrators")]
public void SomeMethod()


for restriction use follow:

C#
[PrincipalPermission(SecurityAction.Deny, Role = @"BUILTIN\Administrators")]
public void SomeMethod()
 
Share this answer
 
If you have a back office, set different permission level to different profile. And save them to database.

When loading a specific module or feature, verify the profile of the current user and make appropriate restriction.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900