My controls already have security, so you have that option. But...
I have a class called Globals. In this class is this code:
Public Enum SecurityType
None = 0
Operators = 10
Maintenance = 20
Supervisor = 30
Engineer = 40
Admin = 50
End Enum
This is where I can globally change the security levels, but generally these 5 are all anyone would need.
Then, in the controls, I have a property...
'******************************
'* Property - Security
'******************************
Private m_Security As myEnums.SecurityType
''' <summary>
''' Choose security for this button
''' </summary>
''' <remarks></remarks>
<System.ComponentModel.Description("Choose security for this button")>
Public Property Security As myEnums.SecurityType
Get
Return m_Security
End Get
Set(ByVal value As myEnums.SecurityType)
m_Security = value
End Set
End Property
Then, for a button, on a button press event, for example, add something like this...
Dim securityText = [Enum].ToObject(GetType(myEnums.SecurityType), m_Security).ToString()
If Globals.LoginLevel >= m_Security Then
Else
Dim x As New Security_Notice
x.Level = securityText
x.ShowDialog()
Return
End If
Globals.LoginLevel is from my login stuff, if you make your own you will need to massage this part. Also, I use my own message popup, if you use your own you will need to edit that part as well.
Go through, read the comments, take a stab at it, then come back if you have questions. The way I did things isn't necessarily the right way, just the way I did it.
James