How Your Controls Security Setup Is Applied

After you complete your Controls Security setup, your application has a list of the forms with Controls Security and the Control Groups linked to each form in the SVPMControlSecurityForms table. Your application also has a list of the controls assigned to each Control Group in the SVPMControlGroupDefinitions table. These two tables are used to build the Control Permissions dialog that application administrators use to assign Controls Security permissions to users.

Building the Control Permissions Dialog

An applicationís Control Permissions dialog looks like this:

The SVPMControlSecurityForms table is used to build the Control Permissions dialogís forms list. The Control Permissions dialog then uses the Control Group IDís in the SVPMControlSecurityForms records to link to the Control Groups table, SVPMControlGroupDefinitions, to build the Control Permissions dialogís list of controls that appears under each form.

Assigning Control Permissions to Users

Application administrators can set up control permissions for individual users or for groups of users through the Control Permissions dialog. When control permissions are saved, the security table, SVPMSecurityData, includes a record for each control for which a user or group has been granted permission. Each SVPMSecurityData table record contains a user ID, a form name and a Control ID. This is the information a form needs to apply Controls Security.

How a Form Applies Controls Security

When a form is run, (1) the Init event of each control on the form that has an entry in its cCSControlID property and (2) the Refresh method of the Toolbar_All class fire code that searches the security table to see if there is a record for the control with the current userís ID, the formís Name (or cCSAltFormName) and the controlís Control ID. If such a security table record is not found, the user has not been granted permission to access the control, and accordingly, the controlís Enabled property is set to .F..


A Practical Example