C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
SessionUserContext Class Referenceabstract

Class for user context of a Session. More...

#include <sessionusercontext.h>

Inherits ReferenceCounter.

Inherited by SessionUserContextBase.

Public Member Functions

virtual bool addRole (OpcUa_UInt32 roleId)=0
 Add a role to the SessionUserContext. More...
 
virtual bool hasRole (OpcUa_UInt32 roleId) const =0
 Check if a specific role is assigned to this SessionUserContext. More...
 
virtual bool removeRole (OpcUa_UInt32 roleId)=0
 Remove a Role from the SessionUserContext. More...
 
virtual UaStatus setIdentity (const UaIdentityMappingRuleType *pIdentity)=0
 Set the identiy for the SessionUserContext (e.g. More...
 
virtual UaStatus setIdentity (const UaUserIdentityToken *pUserIdentityToken)=0
 Set the identiy for the SessionUserContext (e.g. More...
 
virtual UaIdentityMappingRuleType getUserIdentity () const =0
 Set the IdentityMappingRule assigned to the SessionUserContext. More...
 
virtual UaUInt32Array getRoleIds () const =0
 Get a list of RoleIds that are assigned to the SessionUserContext. More...
 
virtual bool isRoot () const =0
 Check if the SessionUserContext has root priviledges. More...
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter ()
 construction
 
virtual ~ReferenceCounter ()
 destruction
 

Detailed Description

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 role that tries to access the information. When a Session is activated the SessionUserContext gets a number of roles assigned and the SessionUserContext stores that information. Any component that needs to check access permissions can query the SessionUserContext to find out if a specific role is assigned to a SessionUserContext or not.

The AccessRestrictions and the RolePermissions are accessible on the UaNode via the NodeAccessInfo interface. The information from both interfaces SessionUserContext and NodeAccessInfo is used to determine if the requested operation like Read, Write or Browse can be executed.

Member Function Documentation

virtual bool SessionUserContext::addRole ( OpcUa_UInt32  roleId)
pure virtual

Add a role to the SessionUserContext.

Parameters
roleIdUnique identifier for the role. This id is set when the role is registered.
Returns
True if the RoleId was successfully added. False the SessionUserContext already had this role before.

Implemented in SessionUserContextBase.

virtual UaUInt32Array SessionUserContext::getRoleIds ( ) const
pure virtual

Get a list of RoleIds that are assigned to the SessionUserContext.

Returns
List of RoleIds.

Implemented in SessionUserContextBase.

virtual UaIdentityMappingRuleType SessionUserContext::getUserIdentity ( ) const
pure virtual

Set the IdentityMappingRule assigned to the SessionUserContext.

Returns
The UaIdentityMappingRule set for the SessionUserContext.

Implemented in SessionUserContextBase.

virtual bool SessionUserContext::hasRole ( OpcUa_UInt32  roleId) const
pure virtual

Check if a specific role is assigned to this SessionUserContext.

Parameters
roleIdUnique identifier for the role. This id is set when the role is registered.
Returns
True if the RoleId is assigned to the SessionUserContext. False otherwise.

Implemented in SessionUserContextBase.

virtual bool SessionUserContext::isRoot ( ) const
pure virtual

Check if the SessionUserContext has root priviledges.

Returns
True if the SessionUserContext has root priviledges. False otherwise.

Implemented in SessionUserContextBase.

virtual bool SessionUserContext::removeRole ( OpcUa_UInt32  roleId)
pure virtual

Remove a Role from the SessionUserContext.

Parameters
roleIdUnique identifier for the role. This id is set when the role is registered.
Returns
True if the RoleId was removed from the SessionUserContext. False otherwise.

Implemented in SessionUserContextBase.

virtual UaStatus SessionUserContext::setIdentity ( const UaIdentityMappingRuleType pIdentity)
pure virtual

Set the identiy for the SessionUserContext (e.g.

Anonymous, UserName, Thumbprint)

Parameters
pIdentityThe identity that was used to activate the Session.
Returns
Good.

Implemented in SessionUserContextBase.

virtual UaStatus SessionUserContext::setIdentity ( const UaUserIdentityToken pUserIdentityToken)
pure virtual

Set the identiy for the SessionUserContext (e.g.

Anonymous, UserName, Thumbprint)

Parameters
pIdentityThe identity that was used to activate the Session.
Returns
Good if converting the UserIdentityToken into a IdentityMappingRule succeeded. Bad otherwise.

Implemented in SessionUserContextBase.


The documentation for this class was generated from the following file: