Disable button for certain users (ContentMenu)
-
How to disable button in the ContentMenu for certain user. I mean, lets say in the login form i have this particular user ADMINISTRATOR, MANAGER, & EXECUTIVE. For the user list button i only want to allow ADMINISTRATOR to view it.?? by the way, thanks a lot for the [View Tab] help. The code works...:-D
-
How to disable button in the ContentMenu for certain user. I mean, lets say in the login form i have this particular user ADMINISTRATOR, MANAGER, & EXECUTIVE. For the user list button i only want to allow ADMINISTRATOR to view it.?? by the way, thanks a lot for the [View Tab] help. The code works...:-D
You need to create roles and demand permissions. Create a Principal permission based on their user and then demand it. Dim myPermission1 as new PrincipalPermission("ADMINISTRATOR", Nothing) Dim mypermission2 as new PrincipalPermission("MANAGER", Nothing) Dim myPermission3 as new Principalpermission("EXECUTIVE", Nothing) Dim myPermission as PrincipalPermission Try myPermission.demand button1.enabled = true Catch 'If they're not in the ManagerGroup it won't run the enabled = true command End Try