cnsGetAccessRight

Returns the AccessRight (value of the defined parameter "propertyKey") as UINT for the given node.

Synopsis

bool cnsGetAccessRight(string cnsPath, string propertyKey, uint &accessRight, string &inheritedNode);

Parameters

Parameter Description
cnsPath ID path of the node
propertyKey The cns property key which is used for getting the AccessRight (e.g. "OA:OPC" for OPC AccessRight)
accessRight AccessRight as UINT
inheritedNode Node from which the AccessRight is inherited

Return value

Returns TRUE if successful and FALSE in case of an error

Errors

Possible errors:

  • Wrong or missing parameters

  • The defined node could not be found

  • No AccessLevel is defined for the given node and no AccessLevel is inherited from another node

Description

Returns the AccessRight (value of the defined parameter "propertyKey") as UINT for the given node. If the AccessRight is not defined at the node itself but inherited from a parent node instead, the node ID of the parent node is returned for inheritedNode. If the AccessRight is defined at the node itself, an empty string is defined for inheritedNode.

If the AccessRight is neither defined at the node nor a parent node, there is no AccessRight for this node and the function returns FALSE.

main()
{
  uint accRight;
  string parent;
  cnsGetAccessRight("System1:View1.Node1", accRight, parent);
}

Availability

UI, CTRL