C++ Based OPC UA Client/Server SDK
1.5.3.346
|
Class for user context of a Session. More...
#include <sessionusercontext.h>
Inherits ReferenceCounter.
Public Types | |
enum | AccessInfoMode { OwnerGroupOther = 0, RoleRoleOther, UserDefined } |
Definition of the PermissionType Enumeration defining the model of the user authorization check. More... | |
Public Member Functions | |
SessionUserContext () | |
Creates a SessionUserContext object with default settings. | |
SessionUserContext (OpcUa_UInt16 userId) | |
Creates a SessionUserContext object with the provided user ID. | |
virtual void | setAccessInfoMode (AccessInfoMode mode) |
Set the AccessInfoMode used for the object. | |
virtual void | setUserId (OpcUa_UInt16 userId) |
Set the user ID for the object. | |
virtual void | setGroups (std::set< OpcUa_UInt16 > groupIds) |
Set the group IDs for the object. | |
virtual void | addMembership (OpcUa_UInt16 groupId) |
Adds a group ID to the list of groups. | |
virtual void | setDefaultPermissions (OpcUa_UInt16 defaultPermissions) |
Set the default permission for the Session. More... | |
virtual void | setRootId (OpcUa_UInt16 rootId) |
Set the root user ID for the server. More... | |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter () | |
construction | |
virtual | ~ReferenceCounter () |
destruction | |
Class for user context of a Session.
OPC UA defines different information model elements like Objects, Variables, Method and Events and different services to access the information. This access can be restricted based on the user that tries to access the information. The user authentication is done during the Session creation and the user information is stored in the Session using this class.
The SessionUserContext stores information about the authenticated user that activated the session and the groups the user is a member in.
The SessionUserContext is used to verify the rights of the user when accessing information in the server address space. The access masks and the authorized user and group are stored in the UaNode with the class NodeAccessInfo. The information from both classes is used to determine if the requested operation like Read, Write or Browse can be executed.
Definition of the PermissionType Enumeration defining the model of the user authorization check.
Enumerator | |
---|---|
OwnerGroupOther |
Check userId with owner and groupIds with group in NodeAccessInfo. |
RoleRoleOther |
OwerId in NodeAccessInfo is used as second role. |
UserDefined |
Node NodeAccessInfo was overwritten by user for application specific user authorization |
|
virtual |
Set the default permission for the Session.
This mask is used for all nodes where no NodeAccessInfo is set.
defaultPermissions | The default permission for the Session. The value is created with the masks defined in PermissionType. |
|
virtual |
Set the root user ID for the server.
If the root ID matches the userID, the user has full access to all information in the server.