![]() |
High Performance OPC UA Server SDK
1.1.1.177
|
The server allows to control access of different users to the addressspace and values of the server. For the authorization to work the Authentication must also be enabled. Authorization is implemented as backend, where the following are currently available:
To activate a backend, the according backend must be selected using the cmake option UA_AUTHORIZATION_BACKEND.
Disables Authorization completely and grants every user access to all node.
The inode is embedded in every node of the addressspace and contains a user id, a group id and the permissions for the user, group and everybody else (other).
Users can be loaded from a users file with the following format:
Users can also be added inside the code:
Groups can be loaded from a groups file with the following format:
Groups can also be added inside the code:
The following table shows the access permissions available in the SDK and the nodeclasses these are applicable to:
Permission | Nodeclass | Description |
---|---|---|
ATTRREADABLE | All | All attributes except the value are readable, nodes without this permission will also not show up in browse results |
ATTRWRITABLE | All | All attributes except the value are writable |
EVENTREADABLE | Object | The Events the node creates are readable |
EXECUTABLE | Method | The function associated to the node can be executed |
READABLE | Variable | The value attribute is readable |
WRITABLE | Variable | The value attribute is writable |
HISTORYREADABLE | Variable | The history of the value attribute is readable |
HISTORYINSERT | Variable | New values can be inserted in the history of the value attribute |
HISTORYMODIFY | Variable | Values in the history of the value attribute can be modified |
HISTORYDELETE | Variable | Values from the history of the value attribute can be deleted |
There are also some composite permissions defined by the SDK:
Permission | Description |
---|---|
OBSERVATION | Read everything: attributes, values, events, history |
OPERATION | Observation plus write values and execute methods |
ALL | All of the available permissions |
All of these permission can be set independently for the user, the group and others. To set the access permissions there is a define for every combination, e.g.:
There is furthermore a special permission UA_ALL_ENCRYPTION_REQUIRED. It ensures the node can only be accessed using an encrypted connection. If this permission is set, it is in effect for user, group and others and is meant to protect confidential nodes.
Access permissions can be set as default permissions for every newly created node after this call:
Access permissions can also be set for a single node:
When implementing a provider, the provider has to check the permissions before providing information to the client. This works independent of the authorization backend using the following functions:
Example when implementing a provider to read the value attribute (other attributes are handled by the SDK in this example):