Using CheckAccess() with Embedded Mimic Parameters in Geo SCADA for Evaluating User Permissions
CheckAccess() method can be used within mimic expressions to determine whether the currently logged-in user has a specific permission on a database object. This is particularly useful when you need to dynamically show or hide mimic objects based on user security rights.Common permission codes include:
RD= ReadBRS= BrowseCTL= ControlOVR= OverrideCFG= ConfigureSEC= SecurityADM= System Administration
The CheckAccess() method returns:
Trueif the user has the specified permissionFalseif the user does not have the specified permission
Standard Visibility Control
A common use case is controlling an object's Visible property based on a user's permissions.
For example:
Visibleis simply the property being animated.CTL(Control) is used as an example permission code.- If the logged-in user has the specified permission, the expression returns 1 (visible).
- Otherwise, it returns 0 (hidden).
The same approach can be applied to other properties and permission codes depending on the intended behavior.
The Challenge with Embedded Mimics
For example, a mimic parameter may be defined as:
Parameter:Point.ObjectLink
However, this does not work as expected because the parameter is treated as a string rather than an object reference.
As a result, Geo SCADA does not evaluate the CheckAccess() method against the target object.
The Correct Solution: Indirect Expressions
To evaluate CheckAccess() against a parameterized object, an indirect expression must be used.
The following syntax allows Geo SCADA to evaluate the constructed object reference at runtime:
Example:
The parameter will:
- Be visible when the user has CTL access.
- Be hidden when the user lacks CTL access.