Menu Security prevents users from accessing menu options that the system supervisor decides they should not access.
Run Load Menu Option Table: Before you can set up Menu Security for an application, you must run the Security Builder – Load Menu Option Table option on the VPM Enterprise Tools menu to create the table of application menu options needed to assign menu permissions. See Load Menu Option Table.
Because Menu Security is assigned to individual users, Menu Security is disabled if User Access Security is turned off.
Tip: Distribute your applications with Menu Security turned off. This is done because users and their passwords must be set up and menu permissions must be assigned before Menu Security is turned on through the Admin Tools dialog.
VPM Enterprise uses the menu generation program GENMENUX to remove menu options that a user is not authorized to access. Users do not even see the options that they cannot access.
Warning: Do not turn on Menu Security before assigning Menu Security permissions. If you do, your application will have no menu options when you run it. If this happens, see User Security Mistakes and How to Recover.
Assigning Menu Permissions
When a new user is added on the Users form, the user does not have permissions for any menu options. You must assign menu permissions to the new user.
You can assign Menu Security permissions to users in two ways:
· Individual Menu Permissions: You can assign menu permissions to a user on an individual basis through the Menu Individual button on the Users form.
· Display the user’s record on the Users form.
· Click the Menu Individual button on the Users form. VPM Enterprise displays the Menu Permissions dialog.
· Follow the instructions in the “Menu Permissions Dialog” section below to assign individual permissions.
· Group Menu Permissions: You can assign a user to the menu permissions that have already been assigned to a group of users.
· Display the user’s record on the Users form.
· Enter the code of the menu permission group to which the user should belong in the Menu Group field. With the cursor on the Menu Group field, press F2 or right-click on the field and select Picklist from the shortcut menu to see a list of the menu permission groups that you have set up.
· Follow the instructions in the “Menu Permission Groups Dialog” and “Menu Permissions Dialog” sections below to set up menu permission groups and assign group permissions.
Menu Permission Groups Dialog
If a group of users will have the same permissions, you can create a menu permissions group and assign permissions to the group. Then, users can simply be assigned to this group instead of having to assign permissions to users individually.
You reach the Menu Permission Groups dialog from the Admin - Security menu.
If you want to find a specific Menu Permission Group, enter the Menu Group code in the Find form and click OK. Otherwise, click OK and the first Menu Permission Group record in order by Group Code will be displayed.
Click the New toolbar button to add a record for a new Menu Permission Group. The fields and button on the Menu Permission Groups dialog are described below.
· Group Code: A three character code to identify the group.
· Description: A descriptive title for the group.
· Comments: A place for you to describe the group.
· Permissions: Click the Permissions button to bring up the Menu Permissions dialog to assign permissions to the group. See the next section.
Menu Permissions Dialog
You use the Menu Permissions dialog to assign menu permissions to individuals and groups. You can reach this dialog from:
· The Menu Individual button on the Users form when you are assigning permissions for an individual.
· The Permissions button on the Menu Permission Groups dialog when you are assigning permissions for a group.
The Menu Permissions dialog lists an application’s menu files in a treeview display. Expanding a menu file node displays the submenus and menu options included in the menu.
Permission Status: To the right of each submenu and menu option is the permission status. A blank means that the option will be included in the user’s menu. An “(x)” means that the option will be excluded from the user’s menu. By default, all menu options are excluded when the Menu Permissions dialog is first accessed for a group or individual.
Tip: In VPME applications, all menus, including shortcut menus, are listed in the menu options list. For VPME itself, only the main menu options are listed.
The control buttons on the Menu Permissions dialog are described below.
· Include / Exclude (x): Click on the Include option button to include the highlighted menu option in the user’s menu. Click on the Exclude option button to exclude the highlighted menu option from the user’s menu. Double-clicking on a menu option toggles its include/exclude status.
Tip: Be sure to include the File/Exit menu option so that the user has a way to exit the application.
· Include All / Exclude All: Clicking the Include All or Exclude All buttons changes the status of all menu options in all menus to “included” or “excluded”, respectively.
· Copy Permissions: Clicking the Copy Permissions button brings up the Copy Permissions dialog where you can copy the permissions assigned to a user or group and make them the permissions of the current user or group. See the next section.
· OK: When you click OK, a record is added to the security table, SVPMSecurityData, for each menu option for which permission has been granted (menu option is included).
Copy Permissions Dialog
The Copy Permissions dialog allows you to assign the permissions of a selected user or group to the current user or group.
· Copy From User / Group: Click on the User option button if you want to copy the permissions of a user. Click on the Group option button if you want to copy the permissions of a group.
· Users List: When the User option button is selected, the Users list is enabled. Highlight the user whose permissions you want to copy.
· Groups List: When the Group option button is selected, the Groups list is enabled. Highlight the group whose permissions you want to copy.
· Copy: Click Copy to copy the selected permissions to the Menu Permissions dialog.
Menu options for which a user does not have access rights are removed from menus through the use of GENMENUX directives that are inserted into the Comment snippet of the menu options. When you add a menu option to an application menu through the VPME Menu Builder, the GENMENUX directives are automatically inserted when the FoxPro Menu Builder is exited and control returns to the VPM Enterprise Menu Builder. Then, when a menu is run, the directives cause the VPM Enterprise menu security routine to be run for each menu option. Those menu options for which the user has been “excluded” are then removed from the menu.