I have a desktop application developed in WPF that has several views displayed as MDI child to the Shell. It is not developed in a Composite/Modularized approach. When the application opens, all the views are ready to be accessed. The application has an Admin user and several Operators.
The requirement is that the Admin user will assign some restricted privileges to the Operators which will specify –
- Which Operators can access/open which Views, and
- Which Operators can perform which actions in the allowed Views
My thought up to this point is to –
- Storing the operator-privilege information in the database
- On loading, storing the currently logged-in user’s privilege info at somewhere application-level
- For the Shell, checking the privilege info at application-level and setting visibility bindings to different View-access buttons according to the info
- For individual Views, checking the privilege info at ViewModel-level and setting visibility bindings to the action buttons according to the info
Is there a better approach for implementing such a scenario?