-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Sinisa has asked that pvDatabaseCPP support access security.
In pull request #58 he proposed changes to PRecord and ChannelProviderLocal
I have reread the epics-base access security in
https://epics.anl.gov/base/R3-16/2-docs/AppDevGuide/AccessSecurity.html#x9-3040008
But the implementation is in the epics-base code for accessing DBRecords.
This it is not usable by pvDatabaseCPP.
Here are my initial thoughts.
Access security should be implemented by ChannelProviderLocal with NO changes in PVRecord.
A configuration file would be something like the following:
{
"rules: : [
{ { "USERS" : "user1 user2 ..."},
{"HOSTS" : "host1 host2..."},
{ "RECORDS" : "record1,..."},
{ "ACCESS": accessdef}
},
...
]
}
Consider the following record
PVRdouble
double value
alarm_t alarm
int severity
int status
string message
time_t timeStamp
long secondsPastEpoch
int nanoseconds
int userTag
Some example accessdefs are
{ "value" : "WRITE","alarm:"READ","timeStamp":{"userTag":"WRITE"}}
"READ" // this makes all fields in the records read only
"NONE"
"WRITE" this is what is available with no access.
If access security is turned on then when ChannelProviderLocal is started it creates a record that provides support for access security. It would have a method:
byte accss(PVRecord record.string user, string host)
byte would have one of the values:
0 read access
1 write access
2 no access
Just my initial thoughts.