So, basically you want to perform something after identifying the
Role of
User.
I assume, that you are having some mechanism to identify Role of a User. For that you might have a
Column in
User Table or a separate table altogether for
User Role.
Just retrieve that
Role value from Database, while User Logs in. Then try to run a logic based on that. Something like below.
string userRole = roleRetrievedFromDatabase;
if(userRole.Equals("manager"))
{
manager.Enabled = true;
employees.Enabled = false;
}
else if (userRole.Equals("employee"))
{
employees.Enabled = true;
manager.Enabled = false;
}