Click here to Skip to main content
15,851,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what i need the system to do is...

1. the manager and ceo can register a user in the system.
1.1. if staff is admin, then admin can only access certain views where as manager will be accessed to all views in the system.
2. accountant to also be registered in to system and can only access the financial section in the system.
3. for registering: username, password, assign role in a dropdown list.
3.1. only manager and ceo can do this.
4. when i login with admins username and password, in the system i must not be able to
access certain views.
5. if manager logs in, he can access everything.
6. when accountant logs in the he can only access financial view.
7. all these users must use 1 login screen.
8. we must use CRUD for roles.
9. no roles must be hard coded.
10. i am using local db (code first)

What I have tried:

i had tried the code given in code project.
i want to add many roles not only admin
CHill60 19-Apr-16 17:03pm    
So you've explained what you want to do, but haven't explained where you are stuck. I know there are articles here on CP that handle multiple roles, not just admin, but if you don't show your code AND tell us what the problem is, then we can't really help
Foothill 19-Apr-16 17:04pm    
If you are using Windows Authentication with Active Directory, you could give the System.DirectoryServices.AccountManangement namespace a try. You could have the users in AD security groups based on permissions then run UserPrincipal.IsMemberOf(GroupPrincipal) to authorize an action.

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