Hi, we’re using MPUserX. I want the interface to respond differently depending on whether a user is logged in or not. However, when I try to read those variables, they come back empty. These are the things I’d like to read:
Is any user logged in?
Put their username in a TextOutput
What’s their access status?
Am I reading the wrong variables? Or is this not possible? I know there’s the widget to read out a username, but it doesn’t quite do what I want it to do. If anyone could point me in the right direction, that would be great. Thanks!
Which one to use depends on your use case. If you are trying to control widget functions / visibility then the properties permissionOperate/View would be the way to go.
The options are explained here - Limiting visibility and operation
Yes exactly that combination. Basically, I’m trying to build a more modern user login and user settings management experience.
When logged out, clicking on a little user icon in the top right gives you a dialog to log in. When logged in, clicking on that same icon opens another dialog to manage user settings such as language, measurement system, and a log out button.
Isn’t there a boolean I can get from the OPC UA? When I try that, nothing happens. Doesn’t that just return true/false?
For displaying the currently logged-in user, I’d prefer to use TextOutput
The only info you have available by default is the ::SYSTEM:clientInfo.userId as mentioned before but there is no simple Boolean unless you make one using the Event LoginSuccess from Login or LoginButton or check against a known user.
The “old” MpUserXLogin might work but is disconnected from the MpUserX - mappView session. So if you have to login using the MpUserXLoginUI and then you can get to CurrentUser, LoggedIn and UserLevel but it doesn’t effect the mappView user.
These, I believe, should be the same calls used internally by the UserList widget.
Without running an in-depth test this may be an option using the OpcUaClient libraries or a mappConnect implementation.
Using the clientSystem event to trigger a Boolean change (or any kind of change) doesn’t seem to do anything, really. In the simulation, on successful login, nothing happens. Is that a simulation issue, maybe? Or because I’m getting a few security notices?