views:

34

answers:

1

In my WPF Desktop sample Book Store application I want to manage Users and Roles. With multiple Users I want to achieve below points

1) Application Should have multiple user
2) User has 3 categories a) Admin b) Manager c) Employee
3) Application can have multiple roles like, add books, sale books, Update Stocks, Generate Purchase Order etc
4) User should be able to assign and remove roles of other user those are lower in herarchy. Ideal User herarchy is like :-

a) Admin - TOP having full Rights
b) Manager - Having roles added and removed by Admin
c) Employee - Having roles added and remover by Manager / Admin.

I need approach to implenet it. Approach should be flexible that In future Roles and User addition / Removal will be easy; without change of Database structure and extra line of codes. Higher manager can easily assign roles to individual employee.

+1  A: 

First, I would refer to your "categories" as "roles" and your current "roles" as "privileges" then you would need the following tables user, roles, privileges, userroles, and userprivileges. Then build all your app logic around records in the link tables. There are some pretty useful membership providers out there(depending on your DB) which you can implement instead of doing it all from scratch. Then you would likely just need to add the privilege tables and procs.

Provider Example video WPF

jumpdart