-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Server access control #2984
Comments
You have to override the config->accessControl->activateSession there you have to set a specific sessionContext so you can distinguish between user. Or you use a struct with all access related values as sessionContext. |
@schroeder- thnx for ur answer, but i still don't understand where i should use the specified sessionContext for each user.
i can here distinguish between the users but as i said, i don't know how to use the sessionContext after that and where should i use it |
Best way is to write a complete new access_control plugin and extend the usernamePasswordLogin with a struct for accessControl settings. But as easy way you can use set
|
thnx once again, but that was not what i want to do, or maybe i missed something |
use getUserAccessLevel function like:
|
@schroeder- i tried it and it don't work, i don't know why here is the variable that i add:
and i checked the matching in activateSession_default:
and in the getUserAccessLevel_default i did as u said:
and it doesn't work, in both situation "User0 or User1" i get in UAexpert BadUserAccessDenied. |
@schroeder- i did something wrong as i changed the getUserAccessLevel_default, so i removed every thing and started once again as in the example, configuring the config->accesscontrol->getUserAccessLevel to a function that i wrote and it is the same, the both users cannot write the value of variable i get a warning every time i want to connect, it is about that i don't use security policy and if i click on ignore the client can connect to server and i can browse the server but not write the variable, do u have any idea what should i do to run it? thnx |
You need to look at getUserRightsMask_default The meaning of the returned bitfield is documented in the standard and here: |
I'm currently trying to implement the same thing as @Feras992
And my getUserAccessLevel like this:
My problem: sessionContext always is a NULL pointer whenever the function is called. |
@Jonas-Bartkowski Maybe you just did not see that at the end of the method "activateSession_default" there is following line: |
Hi all , How can I call these fucntion .. I am using example but , I can call these function . |
@schroeder- must we restart the server ? |
Hi, However my use case is that I want to completely deny access to certain nodes for certain users. So what I've been doing is creating my own getUserAccessLevel and returning 0x00 if I want to deny access. Unfortunately I then see that the client disconnects and connects in a loop. Is this done in allowBrowseNode? Thanks in advance |
@jpfr i set both masks like this, but i see can add or write Nodes. What is wrong? |
@jopi2016 Do you find Solution? |
Hello,
i am running a server on STM32F767 nucleo using FreeRTOS and LwIP and every thing is ok.
i add 2 users according to the example for the server_access_control:
https://github.com/open62541/open62541/blob/master/examples/access_control/server_access_control.c
my question is about to give each user permissions.
it is about like the first user can just read the Variables and can't call any method
the second user can read/write the variables and call methods.
is there any explanation about it or any example?
thnx
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: