I have an application that needs to get into ActiveDirectory in order to get user / role rights when the application starts and persist everywhere.
I don’t want to remove AD on each form in order to double-check user permissions, so I would like for the user role and, possibly, other user login information to be available worldwide in any form of the application, so I can correctly hide the functionality, buttons, etc., if necessary.
Sort of:
if (UserProperties.Role == Roles.Admin)
{
btnDelete.Visible = false;
}
What are the best methods for storing static user data in a Windows application? Solutions like Singleton or global variables may work, but I tried to avoid them.
Is the User object that is passed to each form constructor just as bad?
rg01
source
share