I am trying to implement a simple scheme for user access rights to controls on my forms and user controls. Basically this is what I am looking for,
If (UserCanModify) { TextBox1.Readonly = false;}
I need to do it through out the form or user control - so I thought if I created an inherited class that I could set those rights either automagically somehow.
Basically this is what I am thinking :
MyForm : Form, MyAccessClass
Or
MyControl : UserControl, MyAccessClass
Where MyAccessClass would do the magic of setting access to the Forms/UserControls - controls for read only, button enabled etc..
I admit this is the first time I am implementing any kind of security on an application and it is just simple a user should not be able to do nothing but view and a supervisor should be able to change this or that..
What is a good approach to this , simple is better , automagic of course even better. I know if I have a class that my forms could inherit it would be nice - but again I am not sure how to do this.. any examples are welcome and appreciated, thank you.