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 –
My thought up to this point is to –
Is there a better approach for implementing such a scenario?
Your approach sounds like pretty much OK to me, except for the fact that in addition to hiding several UI elements such as buttons, I would also do checking if operations can be performed by the current user in the ViewModel layer, before actually executing them.
This means that your Commands
should have a CanExecute()
that goes thru your permission validation logic and returns true or false. This is an important security measure, IMO, because UIElements can easily be altered at runtime using tools such as Snoop.
Take a look at this answer How to Snoop proof your wpf application?