ClearSCADA

It is possible to both hide an object and disable a hyperlink based on the privileges of the user currently logged on to ViewX. This can be done by using the EXISTS function.

For this to work you will need to remove Read permissions from the object for the relevant users. Make sure you also remove the Read permissions from the Guest and Everyone users. For example, if there is a mimic that you don't want Fred to see, then Fred's user account should not have read permissions on that mimic.

The EXISTS function checks to see if a tag is valid - the tag is only valid if the function can find the referenced database object in the database and the logged on user has the Read permission to see the object. When the tag is valid, it returns a True value; when the tag is invalid, it returns a False value.

To control the availability of a Mimic object, you can either:

  • Disable a Mimic Object
  • Hide a Mimic Object

The methods described in the sections mentioned above rely on the permissions settings of a 'live' database object. However, you can also use the permissions of an internal database object that has no other purpose in the system other than to control access to a Mimic object (see Using Internal Points to Disable or Hide Mimic Objects Based on User Permissions).

Disable a Mimic Object

You can disable a Mimic object according to the permissions of the currently logged on user. If the currently logged on user has the Read permission for a specific database object, the user will be able to access the pick action functionality of the Mimic object; if they do not have the Read permission, the Mimic object will be visible but will not function when selected.

To disable a Mimic object according to the permissions of the currently logged on user:

  1. Display the Animations window for the Mimic object that provides the pick action features (the hyperlink, button, text box etc.).
  2. On the Animations window, set the PickDisabled property to have the following expression:
    NOT(EXISTS("<FullName of Database Object>"))
    

Where <FullName of Database Object> is the name of the database object that determines the availability of the pick action features. If the logged on user has the Read permission for the defined database object, the pick action features will be available from the Mimic object; if the logged on user does not have the Read permission, the pick action features will be disabled.

  1. Close the Animations window.
  2. Save the Mimic.

For example, a hyperlink on a Mimic could target another Mimic called 'Southern Region.Overview'. This hyperlink only works if the currently logged on user has the Read permission for the 'Southern Region.Overview' Mimic. This is made possible by setting the following animation for the PickDisabled property of the hyperlink object:

NOT(EXISTS ("Southern Region.Overview") )

Hide a Mimic Object

If you want a Mimic object to be hidden from view rather than disabled according to the permissions of the logged on user, you should:

  1. Display the Animations window for the Mimic object that provides the pick action features (the hyperlink, button, text box etc.).
  2. On the Animations window, set the Visible property to have the following expression:
    EXISTS("<FullName of Database Object>")
    

Where <FullName of Database Object> is the name of the database object that determines the visibility of the Mimic object. If the logged on user has the Read permission for the defined database object, the Mimic object will be visible; if the logged on user does not have the Read permission, the Mimic object will be hidden.

  1. Close the Animations window.
  2. Save the Mimic.

Using Internal Points to Disable or Hide Mimic Objects Based on User Permissions

You can use the availability of internal points to determine whether a Mimic object is visible and/or enabled for a user. This is useful when you want to restrict access to pick actions on a Mimic but do not want to change the permissions of objects in the database.

When you use internal points, it is the currently logged on user's permission to Read the internal points that controls whether the user can see a specific Mimic object or access its pick action features.

Typically, this functionality is put into effect with internal points that represent different levels of users. Usually this means there is are 3 internal points:

  • The Administrators internal point has its security settings configured so that only those administrator level users have Read access. Engineer and operator level users do not have the Read permission for the Administrators internal point.
  • The Engineers internal point is configured so that only administrator and engineer level users have Read access to the point. Operator level users do not have the Read permission for the Engineers internal point.
  • The Operators internal point is configured so that all users except Guest users can access it. Administrators, engineers and operators have the Read permission for the Operators internal point.

On a Mimic, a Mimic object can then be configured so that it is enabled/disabled or visible/invisible according to the currently logged on user's Read permission for the three internal points. So, you could have a button that performed a high-level action such as an override. The button is only to be visible and accessible to administrator level users.

It is configured to have this animation on the Visible property (note that you could animate the PickDisabled property instead if required - see Disable a Mimic Object):

EXISTS ("Internal Points.Administrators")

The button also has pick action animations that associate it with an Override control.

When a user displays the Mimic that contains the button, the button is only displayed if that user is logged on via an account with the Read permission for the 'Administrators' internal point. So if the user is an administrator level user, they will have the Read permission and will be able to action an override by selecting the button. Engineer and operator level users will not have the Read permission for the 'Administrators' internal point and so will not be able to see or select the button on the Mimic.