I have done this in many applications.
You have Windows Authentication for your application.
Make some object that can store user credentials and have this object stored in the session for quick recovery. If it is not there, you can quickly rebuild it. I usually install several roles, for example:
enum USER_ROLE : int
{
Role1 = 1,
Role2 = 2,
Role3 = 4,
Role4 = 8,
etc
}
if (Context.User.IsInRole("Roll1Name")) YourUserObject.Roles += USER_ROLE.Role1;
if (Context.User.IsInRole("Roll2Name")) YourUserObject.Roles += USER_ROLE.Role2;
etc
, , , HtmlControl .
Eg. bool SetControlSecurity (HtmlControl ctrl, int iUserRoles, int iControlRoles, ACTION eAction)
, :
SetControlSecurity (pnlUserInfo, YourUserObject.Roles, eRole.Role2, ACTION.Hide);
param , , hide, readonly, clear data ..
:
bool bHasAccess = ((iUserRole & iControlRoles) > 0);
if (bHasAcess)
{
}
else
{
}
, .