open62541pp 0.19.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
accesscontrol_default.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
8
9namespace opcua {
10
11/// Login credentials.
16
17/**
18 * Default access control.
19 *
20 * This class implements the same logic as @ref UA_AccessControl_default().
21 * The log-in can be anonymous or username-password. A logged-in user has all access rights.
22 *
23 * @warning Use less permissive access control in production!
24 */
26public:
27 explicit AccessControlDefault(bool allowAnonymous = true, Span<const Login> logins = {});
28
30
32 Session& session,
33 const EndpointDescription& endpointDescription,
34 const ByteString& secureChannelRemoteCertificate,
35 const ExtensionObject& userIdentityToken
36 ) override;
37
38 void closeSession(Session& session) override;
39
40 Bitmask<WriteMask> getUserRightsMask(Session& session, const NodeId& nodeId) override;
41
42 Bitmask<AccessLevel> getUserAccessLevel(Session& session, const NodeId& nodeId) override;
43
44 bool getUserExecutable(Session& session, const NodeId& methodId) override;
45
46 bool getUserExecutableOnObject(Session& session, const NodeId& methodId, const NodeId& objectId)
47 override;
48
49 bool allowAddNode(Session& session, const AddNodesItem& item) override;
50
51 bool allowAddReference(Session& session, const AddReferencesItem& item) override;
52
53 bool allowDeleteNode(Session& session, const DeleteNodesItem& item) override;
54
55 bool allowDeleteReference(Session& session, const DeleteReferencesItem& item) override;
56
57 bool allowBrowseNode(Session& session, const NodeId& nodeId) override;
58
59 bool allowTransferSubscription(Session& oldSession, Session& newSession) override;
60
62 Session& session,
63 const NodeId& nodeId,
64 PerformUpdateType performInsertReplace,
65 const DataValue& value
66 ) override;
67
69 Session& session,
70 const NodeId& nodeId,
71 DateTime startTimestamp,
72 DateTime endTimestamp,
73 bool isDeleteModified
74 ) override;
75
76private:
77 bool allowAnonymous_;
78 std::vector<Login> logins_;
79 std::vector<UserTokenPolicy> userTokenPolicies_;
80};
81
82} // namespace opcua
Access control base class.
bool allowAddNode(Session &session, const AddNodesItem &item) override
Allow adding a node.
bool getUserExecutable(Session &session, const NodeId &methodId) override
Additional access control for method nodes.
Bitmask< WriteMask > getUserRightsMask(Session &session, const NodeId &nodeId) override
Access control for all nodes.
AccessControlDefault(bool allowAnonymous=true, Span< const Login > logins={})
bool allowAddReference(Session &session, const AddReferencesItem &item) override
Allow adding a reference.
void closeSession(Session &session) override
Deauthenticate a session and cleanup session context.
Span< UserTokenPolicy > getUserTokenPolicies() override
Get available user token policies.
bool allowDeleteNode(Session &session, const DeleteNodesItem &item) override
Allow deleting a node.
bool allowTransferSubscription(Session &oldSession, Session &newSession) override
Allow transfer of a subscription to another session.
bool getUserExecutableOnObject(Session &session, const NodeId &methodId, const NodeId &objectId) override
Additional access control for calling a method node in the context of a specific object.
StatusCode activateSession(Session &session, const EndpointDescription &endpointDescription, const ByteString &secureChannelRemoteCertificate, const ExtensionObject &userIdentityToken) override
Authenticate a session.
bool allowBrowseNode(Session &session, const NodeId &nodeId) override
Allow browsing a node.
bool allowHistoryDelete(Session &session, const NodeId &nodeId, DateTime startTimestamp, DateTime endTimestamp, bool isDeleteModified) override
Allow delete of historical data.
bool allowHistoryUpdate(Session &session, const NodeId &nodeId, PerformUpdateType performInsertReplace, const DataValue &value) override
Allow insert, replace, update of historical data.
Bitmask< AccessLevel > getUserAccessLevel(Session &session, const NodeId &nodeId) override
Additional access control for variable nodes.
bool allowDeleteReference(Session &session, const DeleteReferencesItem &item) override
Allow deleting a reference.
Bitmask using (scoped) enums.
Definition bitmask.hpp:127
UA_ByteString wrapper class.
Definition types.hpp:537
UA_DataValue wrapper class.
Definition types.hpp:1568
UA_DateTime wrapper class.
Definition types.hpp:381
UA_ExtensionObject wrapper class.
Definition types.hpp:1742
UA_NodeId wrapper class.
Definition types.hpp:641
High-level session class to manage client sessions.
Definition session.hpp:20
View to a contiguous sequence of objects, similar to std::span in C++20.
Definition span.hpp:29
UA_StatusCode wrapper class.
Definition types.hpp:44
UA_String wrapper class.
Definition types.hpp:256
UA_AddNodesItem wrapper class.
Definition types.hpp:715
UA_AddReferencesItem wrapper class.
Definition types.hpp:793
UA_DeleteNodesItem wrapper class.
Definition types.hpp:860
UA_DeleteReferencesItem wrapper class.
Definition types.hpp:911
UA_EndpointDescription wrapper class.
Definition types.hpp:271
PerformUpdateType
Perform update type for structured data history updates.
Definition types.hpp:2447
Login credentials.