HideVAM Based on Security Privileges

The HideVAM application property can be set true to hide the VTScada Application Manager (VAM) from view. While useful, this is not especially convenient since it depends on having an application set to auto-start, and at least one user account in that application granted the privilege of seeing the VAM.

You can create a service module for any application that, while the application is running, will control the value of HideVAM on a workstation based on privilege or other property of a logged-in user.

The complete text of the module is as follows. It uses the SecurityCheck function to inquire as to whether the signed-in user possesses the Manager privilege (PrivBitManager). HideVAM is then set to the opposite of the test for this privilege (thus the VAM is not hidden if the privilege is set).

You must use HideVAM rather than the older version, HideWAM.  HideWAM is now checked only on startup, and is only used to set the initial value of HideVAM.

{========================== HideVAM ==============================}
{ Hides the VTScada Application Manager based on security level   }
{=================================================================}
[
  CanConfigure             { Set if we can view VAM               };
]

Run [

  CanConfigure = PickValid(\SecurityManager\SecurityCheck(
                      \SecurityManager\PrivBitManager, 1), 1);

  If Watch(1, CanConfigure);
  [
     { Set the WAM's visibility based on security manager check }
    \SysLib\HideVAM = !CanConfigure;
  ]
]
{ End of HideVAM }

You may choose any security privilege you wish. Reminder: Privilege numbers can be displayed in the Privileges dialogue. (Protect Pages and Output Tags)

The module must be declared in the [Services] section of the application's AppRoot.SRC file.