Question

I am in the phase of designing Role based access list in which the Roles will be assigned to Groups rather to individual users, please see the screen shot of excel file for full Idea of tables.

There are 6 Tables.

User, Group, UserGroup, Role, GroupRole, Menu

UserGroup (Many to Many between User and Group) GroupRole (Many to Many between Role and Group)

Now what I want to is based on the Group I want to implement the Menu and fetch its menu items and populate my Navigation Bar Items. The Menu table is also visible in the screen shot.

I need experts advice on how to achieve the linking of Menu with the Group, I think the Menu should have a link with Group with (Many to Many )but I need your advice here.

Result: At the end what I want is that when a user will login based on his Group his menu will be populated in our WPF application and then based on his roles he will able to use the application.

Please guide if I am not on the right track. enter image description here

Was it helpful?

Solution

You need to implement properties/methods that evaluate permissions of the current user (e.g. CurrentUser.AllowedToCreate, CurrentUser.AllowedToRead, ...). To reduce the number of permissions you might use enum flags (AllowedToCreate = AllowedToRead + AllowedToCreate).

Then on the WPF side you can control the Visibility/IsEnabled of the menu items by DataTriggers (MultipleDataTriggers).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top