How to get the actual user logged

Find and share HowTos to various installations / configurations!
8 posts • Page 1 of 1
Alfredo@76
Posts:17
Joined: Tue Feb 11, 2020 5:06 pm

How to get the actual user logged

Post by Alfredo@76 »

Hi to everyone,
i am new in this community!
So, for my application, i'm building some custom popup, and i need to block some funcionality when the logged user hasn't an enough rights.
What i did, is to check the logged user with the "getUserPermission" function, inside the init event of my object.
But this works when i open it only, to update my block when it's already opened, i should link the "getUserPermission" function, inside a "dpConnect", but every time i try to do so, i fail.
Does someone explane how to get dinamycally, the current logged user?
Is already exsisting an internal DP with this information?

Thanks.
Regards.
Alfredo.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to get the actual user logged

Post by leoknipp »

Do you have the use case that the logged in user changes while the panels are opened where you want to check the user permissions?

Best Regards
Leopold Knipp
Senior Support Specialist

Alfredo@76
Posts:17
Joined: Tue Feb 11, 2020 5:06 pm

Re: How to get the actual user logged

Post by Alfredo@76 »

Hi, yes i have,
I have a PID popup, and some functionality must be inhibit when logged user is operator, and enabled when root.
So the Logged user could be changed while the popup is opened.
I would like to store the name of the logged user into a DP, in order to connect it with a dpConnect inside my popup, otherwise, with a getUserPermission, inside init tab, i have to close and open again, to update it.
i've attached a file to explane it.
Kind Regards.
Alfredo.
Attachments
getUserPermission.pdf
(108.87 KiB) Downloaded 275 times

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to get the actual user logged

Post by leoknipp »

When using the login/logout functions the current user name is written to _Ui_<num>.UserName.
If you do a dpConnect() for this element you can get the information that the user has changed.

Best Regards
Leopold Knipp
Senior Support Specialist

Alfredo@76
Posts:17
Joined: Tue Feb 11, 2020 5:06 pm

Re: How to get the actual user logged

Post by Alfredo@76 »

HI Leopold,
Thanks for your support, i'll try that, and i'll let you know the result.

Kind Regards.
Alfredo.

Alfredo@76
Posts:17
Joined: Tue Feb 11, 2020 5:06 pm

Re: How to get the actual user logged

Post by Alfredo@76 »

Hi Leopold,
Yes, I did it!

But i still have some doubt about the _UI_<num>.UserName.

Is this a DataPoint?
Should i found it in the Para internal point?

I would like to know more about it, and in general about the _UI_ data points.

Thanks a lot for your support.
Kind Regards.
Alfredo.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to get the actual user logged

Post by leoknipp »

At _Ui_<num> you must replace <num> with the number for the UI manager you are using. The _Ui datapoints you find at the datapoint type _Ui in the PARA module.

In the WinCC OA Documentation you can find information for the _Ui datapoint in the chapter Reference tables --> Internal datapoint types.

If you are interested in getting knowledge about the the basics of WinCC OA you can attend a training. An overview for the trainings you can find at the ETM homepage:
http://www.etm.at/index_e.asp?id=11&m0id=89

Best Regards
Leopold Knipp
Senior Support Specialist

Alfredo@76
Posts:17
Joined: Tue Feb 11, 2020 5:06 pm

Re: How to get the actual user logged

Post by Alfredo@76 »

Hi Leopold,
Sorry for my late reply, and thanks for the informations.
I'll think about the course.

Thanks a lot.
Kind Regards.
Alfredo.

8 posts • Page 1 of 1