UaModeler  1.6.3.454
Extensions

NodeAccessInfo

Introduction

NodeAccessInfo is a structure defined by Unified Automation. Using this structure you can specify access rights on a per node basis. These access rights are:

  • Read Attributes
  • Read Value
  • Write Value
  • Browse
  • Read History
  • Insert History
  • Modify History
  • Delete History
  • Subscribe Events
  • Execute Method
  • Write Attributes

You can specify the access rights for

  • two roles and other
  • or for a user, a group and other

In addition, you can specify that a secure channel that supports signing and/or encryption is required to access the node. These settings are used for all users/groups/roles.

Note
Not all access rights have a meaning for all node classes. “Write Value”, e.g., doesn’t have a meaning for methods.
UaModeler supports two roles per node. If you want to define access rights for more than two roles, you have to do this manually in code.

The NodeAccessInfo is stored in the binary file and in the NodeSet2 XML file (as a user defined extension).

Please see HowTo: Using NodeAccessInfo for an example about using NodeAccessInfo with the .NET based OPC UA SDK.

Enabling NodeAccessInfo

NodeAccessInfo is disabled by default. It can be enabled in the Edit Settings dialog by checking the box “NodeAccessInfo enabled”.

UaModeler supports two modes of NodeAcccessInfo:

Role – Role
Access rights can be set for two roles separately. The only restriction is that both roles must at least have the same rights as Other.
User – Group
Group must at least have the same rights as Other, User must at least have the same rights as Group.

Be aware that not all modes are supported by each of Unified Automation’s SDKs:

  • The ANSI C SDK supports User – Group.
  • The C++ SDK supports both modes.
  • The .NET SDK supports Role – Role.

Adding Users and Groups

Before you can assign rights for different users, groups, or roles, it is necessary to define the names for these users, groups or roles that are to be used in a project. Right click on “Models” in the Project Window and choose “Edit names for NodeAccessInfo” from the context menu. Depending on which mode is set, the dialog contains a single list of roles or two lists, one for “Users” and one for “Groups”. To add a new user, group, or role, insert text to the empty field at the bottom of the list. To remove a user, group, or role, delete the text from the field.

UaModeler comes with a set of default roles/groups. When checking the box “Add Default Roles” in the Edit Settings dialog, the following defaut roles/groups are added to the project:

  • Anonymous
  • Administrator
  • SecurityAdmin
  • ConfigurationAdmin
  • Operator
  • Observer

Setting NodeAccessInfo for a Node

To set the NodeAccessInfo for a node, select the node in the Information Model Window. Then switch to the Extensions View. For being able to specify any NodeAccessInfo, it is necessary to check the box “Specify NodeAccessInfo” first.

Now you can specify access rights as required, separately for each permission type, by checking the boxes that are arranged in three columns. Depending on what mode is set in the Edit Settings dialog, these columns are titled “User”, “Group”, and “Other” or “Role1”, “Role2”, and “Other”. Permission types that are put in parentheses don’t apply for the selected node. Nevertheless, it is possible to grant these permissions, because NodeAccessInfos may be automatically applied to children or hierarchically referenced nodes (see below).

To choose for what user/group/role these access rights apply for the selected node, UaModeler provides two drop-down menus directly below the columns. Depending on the mode, you can choose “User” and “Group” or “Role1” and “Role2” from the list.

The last drop-down menu controls whether the NodeAccessInfo only applies to the selected node or is automatically applied to other nodes as well. There are three alternatives to choose from. NodeAccessInfo can be applied to

this node
only the selected node
all children
the selected node and all children
all hierarchically
the selected node and all nodes that are hierarchically referenced in forward direction from the selected node

Setting NodeAccessInfo for a Model

It is possible to specify a default NodeAccessInfo for a model. This default NodeAccessInfo applies for all nodes belonging to the model as long as no other NodeAccessInfo is assigned for that particular node. Right click on the model in the Project Window. Then choose “Set model extensions…” from the context menu. A dialog for setting extensions for the whole model will open. You can set the default NodeAccessInfo for the model similarly as described above.

User Defined Extensions

The schema for NodeSet2 XML files defined by the OPC Foundation (http://opcfoundation.org/UA/2011/03/UANodeSet.xsd) allows to specify user defined extensions to nodes and models.

UaModeler allows you to create such extensions. The GUI contains an XML editor for displaying and editing extensions.

Note
The extensions are saved in the binary file and XML file respectively. The extensions are not evaluated in the generated code.

User defined extensions are disabled by default. To enable this feature, select SettingsEdit Settings… from the menu to open the Edit Settings dialog. Then check the box “User defined extensions enabled”.

It is recommended to specify an own XML namespace for user defined extensions. This is useful if own XML parser code should be used. The namespace URI for extensions can be set in the field “Default Extension Namespace URI”. This namespace is automatically added by the XML editor if no other namespace is typed in. The default extension namespace URI is saved in the project file.

Note
The default namespace is not added to existing extensions.

To enter extensions for a node, select it in the Information Model Window. Then switch to the Extensions View and expand “Custom Extensions” if necessary. When klicking on “Add Extension”, an empty extension field is added. Delete the text to remove the extension.

The editor offers tag completion and validates if the entered text is valid XML. It does not validate the text against a schema. If the entered text is not valid, the OK button is disabled. You can click on “Validate Extension” to display a hint about what is invalid and where the error can be found (line and column numbers).

custom_extension.png

Node Documentation

UaModeler provides an editor to enter documentation for nodes. This documentation is saved in the model files (*.ua and *.xml) and can be included in the generated source files and used by tools that generate documentation from source files (like doxygen. This feature is disabled by default. It can be enabled in the Edit Settings dialog.

To enter documentation, select a node in the Information Model Window and switch to the Extensions View. Expand “Node Documentation” if necessary and enter your documentation to the input field. Confirm with OK. The documentation is also visible in the Attributes Window.

node_documentation.png

By default, “Table and List Support” is checked in the Edit Settings dialog. The editor supports markdown tables and lists (see example below). If you need to enter such text that should not be treated as markdown code, disable this setting in the Edit Settings dialog.

- item 1
- item 2
- item 3
head 1 | head 2
-------|-------
cell 1 | cell 2
cell 3 | cell 4

If you want to add documentation to the model but don’t include it in the generated code, check the box “Disable Code Generation” in the Edit Settings dialog. This setting does not disable generic documentation.

Note
You can enter documentation for all nodes, but not everything is included in the generated code.