Hints:
You can create a class to define the privileges of a user.
Example:
public class User
{
public Privilege UserType { get; set; }
public string UserName { get; set; }
public enum Privilege
{
Admin,
Supervisor,
User
}
}
After that, you can initialize the user any where in your application. Then you can hide or show the items that are allowed to be viewed by the user based on his/her privilege.
Example:
public Form2()
{
InitializeComponent();
User user = new User();
user.UserType = User.Privilege.Admin;
button_Admin.Visible = false;
button_Supervisor.Visible = false;
button_User.Visible = false;
switch (user.UserType)
{
case User.Privilege.Admin:
button_Admin.Visible = true;
button_Supervisor.Visible = true;
button_User.Visible = true;
break;
case User.Privilege.Supervisor:
button_Supervisor.Visible = true;
button_User.Visible = true;
break;
case User.Privilege.User:
button_User.Visible = true;
break;
default:
break;
}
}