diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md
index 6df2527..fdfcb44 100644
--- a/documentation/RELEASE_NOTES.md
+++ b/documentation/RELEASE_NOTES.md
@@ -2,6 +2,11 @@
This document summarizes the changes to the module between releases.
+## Release 4.6.0 (EPICS 7.0.5.* March 2021)
+
+* Access Security is now supported.
+* Special support has been revised and extended.
+
## Release 4.5.3 (EPICS 7.0.5 Feb 2021)
* The previously deprecated destroy methods have been removed.
diff --git a/documentation/pvDatabaseCPP.html b/documentation/pvDatabaseCPP.html
index 5e38a06..f5f6721 100644
--- a/documentation/pvDatabaseCPP.html
+++ b/documentation/pvDatabaseCPP.html
@@ -4,72 +4,66 @@
-
Overview
+Documentation for pvDatabaseCPP is available at:
+
+pvDatabase
+
+
+
pvDatabaseCPP is one of the components of
-EPICS Version 7
+
+EPICS-7
+
This document is only a guide to help locate code and documentation related to pvDatabaseCPP
+
+
It is intended for developers that want to use pvDatabaseCPP.
Developer Guide
@@ -79,204 +73,28 @@ href="https://mrkraimer.github.io/website/developerGuide/developerGuide.html">
developerGuide
-
This guide discusses all the components that are part of an EPICS V4 release.
+
This guide provides an overview of the components that are part of an EPICS V4 release.
Some understanding of the components and how they are related is necessary in order to
develop code that uses pvDatabaseCPP.
-In particular read everything related to pvDatabase.
-
-
pvDatabase has plugin support, which is implemented in pvCopy.
-pvCopy was originally implemented in pvDataCPP,
-but pvDatabaseCPP now implements its own version and adds plugin support.
-
-
-See
-
-pvRequest
-
-for details.
-
-
The developerGuide discusses code in a way that applies to both CPP and C++.
-For the descriptions of the CPP specific code consult the following sections.
+In particular read everything related to pvaClient.
doxygen
doxygen documentation is available at
doxgen
+href="./html/index.html">doxygen
-
pvDatabaseCPP
-
include/pv
-
The header files that describe the various components implemented by pvDatabase.
-
-
- - pvDatabase.h
- -
- This describes PVRecord and PVDatabase.
-
- - channelProviderLocal.h
- -
- This describes a channel provider for PVDatabase
-
- - pvSupport.h
- -
- This is the base class for support attached to a field of a record.
-
- - controlSupport.h
- -
- This is support that implements control limits.
-
- - scalarAlarmSupport.h
- -
- This is support for a alarm limits for a scalar numeric field.
-
- - processRecord.h
- -
- This is a PVRecord that periodical processes a set of PVRecords in the local PVDatabase.
-
- - addRecord.h
- -
- This is a PVRecord that adds a new PVRecord to the local PVDatabase.
-
- - removeRecord.h
- -
- This is a PVRecord that removes a PVRecord in the local PVDatabase.
-
- - traceRecord.h
- -
- This is a PVRecord that sets the trace value for another PVRecord in the local PVDatabase.
-
- - pvStructureCopy.h
- -
- This is a facility that allows a client to access a subfield of the fields in a PVRecord.
- It also provides record and field options an plugin support.
-
- - pvPlugin.h
- -
- This is the base class for a plugin attached to a record or field of PVRecord.
-
- - pvArrayPlugin.h
- -
- A plugin for accessing a subset of the elements in an array field.
-
- - pvDeadbandPlugin.h
- -
- A deadband plugin for monitors.
-
- - pvTimestampPlugin.h
- -
- A plugin for timeStamp.
-
-
-
src/database
-
This has the code that implements pvDatabase and pvRecord.
-
src/pvAccess
-
This has the code for the channel provider for pvDatabase.
-
-
src/support
-
This has the pvSupport code.
-
src/special
-
-This has the code for processRecord, addRecord, removeRecord, and traceRecord.
-
-
src/copy
-
This has the code for pvStructureCopy and all the plugin support.
-
exampleCPP
-
Example code is available as part of this release.
+
Example code is available at
exampleCPP
-
In particular look at the example code mentioned in the following sub-sections.
+
In particular look at database, exampleLink, and helloPutGet.
-
database
-
This has many examples of how to create both soft records and records that implement
-other functionality.
-
- - exampleDatabase.cpp
- -
- This shows how to create soft records of each pvData type.
- In addition shows how to create instances of the following two records.
-
- - exampleHelloRecord.cpp
- -
- This is a simple "hello world" that is intentended to be used via a channelPutGet request.
-
- - exampleHelloRPC.cpp
- -
- This is a simple "hello world" that is intentended to be used via a channelRPC request.
-
- - exampleDatabaseMain.cpp
- -
- This shows how to create a standalone IOC.
-
- - ioc and iocBoot
- -
- This has code and examples to create a V3 IOC which also has a PVDatabase.
-
-
-
exampleLink
-
This shows how to implement a record that has a link to another record
-
- - exampleMonitorLinkRecord
- -
- This creates a monitor link to another record.
-
- - exampleGetLinkRecord
- -
- This creates a get link to another record.
-
- - examplePutLinkRecord
- -
- This creates a put link to another record.
-
-
-
-
support
-
This creates records that have the following features:
-
- - value
- -
- Each record has a value field the is a numeric scalar field.
- In addition each has the following fields:
- alarm,timeStamp,control,scalarAlarm, and display.
-
- - support
- -
- Each record uses the control and scalarAlarm support provided by pvDatabaseCPP.
-
-
-
-It also creates records that can be used by clients to show example of the plugin support.
-
-
-
iocshell commands
-
Shell commands are made available via the standard DBD include mechanism
-provided by iocCore.
-The following provide EPICS V4 shell commands:
-
-pvAccessCPP
-qsrv
-pvDatabaseCPP
-
-
-
pvDatabaseCPP provides the following iocshell command.
-
- - registerChannelProviderLocal
- - Including registerChannelProviderLocal.dbd as a dbd file automatically starts provider local
- and also creates the pvdbl shell command.
-
- - pvdbl
- - Provides a list of all the pvRecords in database master
-
-
-
In addition any code that implements a PVRecord must implement an ioc command.
-Look at the examples in exampleCPP/support to see how to implement shell commands.
-
-
+
diff --git a/src/pv/channelProviderLocal.h b/src/pv/channelProviderLocal.h
index 1670e2f..cc7d5f0 100644
--- a/src/pv/channelProviderLocal.h
+++ b/src/pv/channelProviderLocal.h
@@ -362,6 +362,12 @@ public:
* @return true if client can write
*/
virtual bool canWrite();
+ /**
+ * @brief determines if client can read
+ *
+ * @return true if client can read
+ */
+ virtual bool canRead();
protected:
shared_pointer getPtrSelf()
{
diff --git a/src/pvAccess/channelLocal.cpp b/src/pvAccess/channelLocal.cpp
index 99acb7b..af2b4ce 100644
--- a/src/pvAccess/channelLocal.cpp
+++ b/src/pvAccess/channelLocal.cpp
@@ -328,6 +328,13 @@ void ChannelGetLocal::get()
{
ChannelGetRequester::shared_pointer requester = channelGetRequester.lock();
if(!requester) return;
+ ChannelLocalPtr channel(channelLocal.lock());
+ if(!channel) throw std::logic_error("channel is deleted");
+ if(!channel->canRead()) {
+ Status status = Status::error("ChannelGet::get is not allowed");
+ requester->getDone(status,getPtrSelf(),PVStructurePtr(),BitSetPtr());
+ return;
+ }
PVRecordPtr pvr(pvRecord.lock());
if(!pvr) throw std::logic_error("pvRecord is deleted");
try {
@@ -489,6 +496,13 @@ void ChannelPutLocal::get()
{
ChannelPutRequester::shared_pointer requester = channelPutRequester.lock();
if(!requester) return;
+ ChannelLocalPtr channel(channelLocal.lock());
+ if(!channel) throw std::logic_error("channel is deleted");
+ if(!channel->canRead()) {
+ Status status = Status::error("ChannelPut::get is not allowed");
+ requester->getDone(status,getPtrSelf(),PVStructurePtr(),BitSetPtr());
+ return;
+ }
PVRecordPtr pvr(pvRecord.lock());
if(!pvr) throw std::logic_error("pvRecord is deleted");
try {
@@ -522,7 +536,7 @@ void ChannelPutLocal::put(
ChannelLocalPtr channel(channelLocal.lock());
if(!channel) throw std::logic_error("channel is deleted");
if(!channel->canWrite()) {
- Status status = Status::error("Channel put is not allowed");
+ Status status = Status::error("ChannelPut::put is not allowed");
requester->putDone(status,getPtrSelf());
return;
}
@@ -689,9 +703,9 @@ void ChannelPutGetLocal::putGet(
if(!requester) return;
ChannelLocalPtr channel(channelLocal.lock());
if(!channel) throw std::logic_error("channel is deleted");
- if(!channel->canWrite()) {
- Status status = Status::error("Channel putGet is not allowed");
- requester->putGetDone(status,getPtrSelf(),pvGetStructure,getBitSet);
+ if(!channel->canWrite()||!channel->canRead() ) {
+ Status status = Status::error("ChannelPutGet::putGet is not allowed");
+ requester->putGetDone(status,getPtrSelf(),PVStructurePtr(),BitSetPtr());
return;
}
PVRecordPtr pvr(pvRecord.lock());
@@ -722,6 +736,13 @@ void ChannelPutGetLocal::getPut()
{
ChannelPutGetRequester::shared_pointer requester = channelPutGetRequester.lock();
if(!requester) return;
+ ChannelLocalPtr channel(channelLocal.lock());
+ if(!channel) throw std::logic_error("channel is deleted");
+ if(!channel->canRead()) {
+ Status status = Status::error("ChannelPutGet::getPut is not allowed");
+ requester->getPutDone(status,getPtrSelf(),PVStructurePtr(),BitSetPtr());
+ return;
+ }
PVRecordPtr pvr(pvRecord.lock());
if(!pvr) throw std::logic_error("pvRecord is deleted");
try {
@@ -749,6 +770,13 @@ void ChannelPutGetLocal::getGet()
{
ChannelPutGetRequester::shared_pointer requester = channelPutGetRequester.lock();
if(!requester) return;
+ ChannelLocalPtr channel(channelLocal.lock());
+ if(!channel) throw std::logic_error("channel is deleted");
+ if(!channel->canRead()) {
+ Status status = Status::error("ChannelPutGet::getGet is not allowed");
+ requester->getPutDone(status,getPtrSelf(),PVStructurePtr(),BitSetPtr());
+ return;
+ }
PVRecordPtr pvr(pvRecord.lock());
if(!pvr) throw std::logic_error("pvRecord is deleted");
try {
@@ -1325,9 +1353,15 @@ bool ChannelLocal::canWrite()
return false;
}
+bool ChannelLocal::canRead()
+{
+ if(!asActive || (asClientPvt && asCheckGet(asClientPvt))) {
+ return true;
+ }
+ return false;
+}
ChannelLocal::~ChannelLocal()
{
-// cout << "~ChannelLocal()" << endl;
if(asMemberPvt) {
asRemoveMember(&asMemberPvt);
asMemberPvt = 0;