Applies To: |
|
Summary: |
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? |
Solution: |
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()
TaskNew("RecipeSecurity","",1); //create a task to run as background code END //====================================================================================== 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 END END END //======================================================================================================== FUNCTION ResetRecipeSecurity() _OBJECTSetProperty(ObjectByName("AN37"),"Privilege",0); //restart function when logout. END |
Keywords: |
CiRecipe, Security, Read/Write |
Related Links
Attachments