Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Provide callback for AccessLevel attribute #4138

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

matkonnerth
Copy link
Contributor

@matkonnerth matkonnerth commented Jan 23, 2021

In some situations the write access to a variable node is not possible, e.g. the backend is not connected or device/machine is in a state where change of a certain variable is not possible. For such use cases a callback could be provided, which calculates the accessLevel.

For me the user access level attribute should consider only the user/role permissions attached to the session.

Todos:
add tests
same callback should be possible for the executable flag for methods -> executable flag is a boolean
Move accessLevel and Callback in an union type -> doesn't really make sense, if callback is there, invoke it

@matkonnerth matkonnerth changed the title [WIP] Provide callback for AccessLevel attribute [REVIEW] Provide callback for AccessLevel attribute Jan 26, 2021
@jpfr
Copy link
Member

jpfr commented Jan 27, 2021

This is a good feature.
Please indicate the relation of this feature with getUserAccessLevel in the AccessControl plugin.
Furthermore, there are probably many other cases where we want to override the nodestore.
I would prefer a solution that works for all attributes and not only for AccessLevel.
For example with a bitmask that indicates which attribute is "overridden".

UA_Byte (*getUserAccessLevel)(UA_Server *server, UA_AccessControl *ac,

@matkonnerth
Copy link
Contributor Author

Makes sense for me, I've changed the callback for reading a generic attribute value. I haven't considered writing an attribute up to now. If this is really necessary, the callback for reading/writing attributes should look like the DataSource callback.

@matkonnerth
Copy link
Contributor Author

have to think of the writeMask and using DataSource struct for attribute read/write

@matkonnerth
Copy link
Contributor Author

switch back to WIP, this is only experimental

@matkonnerth matkonnerth changed the title [REVIEW] Provide callback for AccessLevel attribute [WIP] Provide callback for AccessLevel attribute Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants