form versions on different logoned users?

  • Thread starter Thread starter Alan Zhong
  • Start date Start date
A

Alan Zhong

my form has a main menu, a datagrid, a set of controls displaying one
record of data, and a set of control buttons corresponding the
menuitems in the main menu, and maybe some context menus too.

my question is, user A belongs to group A, user B belongs to group B.
how do i manage the versions of the form according to which users is
logoned?

for example, when user/group A logs on, button A will be invisible,
main menu has no print function; when user/group B logs on, different
scenario will come up. is there any recommanded ways to manage these?
i mean, not just using the IF..THEN..ELSE to determine all the case in
the form and have to change it and re-compile it every time. should i
kinda make a matrix storing these information?
 
In my case, I only had to deal with three groups; Read, Read/Write,
Read/Write/Print and of course, administrator rights. I created
usercontrols based on each control that needed the security. To those, I set
properties to true/false for each of the three groups needed. Then in the
designer, I selected either true of false for each of the groups. The true /
false then set the visibility of each control. Not sure if their is an
easier way or not.

The menu was a bit trickier with a fair amount of if....then...else. One of
these days, I will go back and clean it up.

HTH,
Brian
 
Hmmm off of the top of my head, maybe you could try try a UserRank
class with a Permissions structure (maybe a boolean array). And then
you could make a procedure that stablishes the permissions...

MainMenu.OpenOption.Enabled = MyUserRank.Permissions(0)
MainMenu.CloseOption.Enabled = MyUserRank.Permissions(1)
MainMenu.PrintOption.Enabled = MyUserRank.Permissions(2)
....

Uh for example that is :D
 
Back
Top