Applies To:
  • CitectSCADA 5.50, 5.50 Service Pack A, 5.50 Service Pack B, 5.50 Service Pack C, 6.00

How do I configure Cirecipe so I can have security access to the object, whereby user without sufficient privilege can only read the data, while user with privilege can read and write to those data? 

The security of CiRecipe Control is not automatically integrated with CitectSCADA. There are two public properties defined in the control to allow users to interface with CitectSCADA security but you have to write some Cicode to implement the functionality.

1. Property Privilege - the privilege threshold
2. property AccessPrivilege - should contain the privilege of the currently logon user of CitectSCADA.

If AccessPrivilege is equal to or greater than Privilege, the data on the control could be modified.

Below is an example code using CiRecipe Control with the animation point as 37.
In your CiRecipe set the privilege level in "Appearance", "General tab". Please do not be confused with setting it at the wrong place such as in the Access tab.
On the page properties under "Events", "On Page Entry" called the function InitialiseSecurity().
On the User Logout button called the function ResetRecipeSecurity()

FUNCTION InitialiseSecurity()

    TaskNew("RecipeSecurity","",1); //create a task to run as background code



FUNCTION RecipeSecurity()

    INT iUserPriv;

    INT iAccessPriv;

    WHILE 1 DO //Allow background call to run continuosly while page is shown

        iUserPriv = GetPriv(5,0) //get priv

        Sleep(2); //go to sleep for a while reduce load /

        IF (iUserPriv =1) THEN

            iAccessPriv =_ObjectGetProperty(ObjectByName("AN37"), "AccessPrivilege"); //get ActiveX properties

            _OBJECTSetProperty(ObjectByName("AN37"),"Privilege", iAccessPriv); //Set ActiveX properties





FUNCTION ResetRecipeSecurity()

    _OBJECTSetProperty(ObjectByName("AN37"),"Privilege",0); //restart function when logout.



CiRecipe, Security, Read/Write