|
@@ -523,3 +523,40 @@ UA_Server_run(UA_Server *server, volatile UA_Boolean *running) {
|
|
|
}
|
|
|
return UA_Server_run_shutdown(server);
|
|
|
}
|
|
|
+
|
|
|
+#ifdef UA_ENABLE_HISTORIZING
|
|
|
+/* Allow insert of historical data */
|
|
|
+UA_Boolean
|
|
|
+UA_Server_AccessControl_allowHistoryUpdateUpdateData(UA_Server *server,
|
|
|
+ const UA_NodeId *sessionId, void *sessionContext,
|
|
|
+ const UA_NodeId *nodeId,
|
|
|
+ UA_PerformUpdateType performInsertReplace,
|
|
|
+ const UA_DataValue *value) {
|
|
|
+ if(server->config.accessControl.allowHistoryUpdateUpdateData &&
|
|
|
+ !server->config.accessControl.allowHistoryUpdateUpdateData(server, &server->config.accessControl,
|
|
|
+ sessionId, sessionContext, nodeId,
|
|
|
+ performInsertReplace, value)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+/* Allow delete of historical data */
|
|
|
+UA_Boolean
|
|
|
+UA_Server_AccessControl_allowHistoryUpdateDeleteRawModified(UA_Server *server,
|
|
|
+ const UA_NodeId *sessionId, void *sessionContext,
|
|
|
+ const UA_NodeId *nodeId,
|
|
|
+ UA_DateTime startTimestamp,
|
|
|
+ UA_DateTime endTimestamp,
|
|
|
+ bool isDeleteModified) {
|
|
|
+ if(server->config.accessControl.allowHistoryUpdateDeleteRawModified &&
|
|
|
+ !server->config.accessControl.allowHistoryUpdateDeleteRawModified(server, &server->config.accessControl,
|
|
|
+ sessionId, sessionContext, nodeId,
|
|
|
+ startTimestamp, endTimestamp,
|
|
|
+ isDeleteModified)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+
|
|
|
+}
|
|
|
+#endif // UA_ENABLE_HISTORIZING
|