Page 1 of 1

VLF-ONE Get Active Profile On Client Side

Posted: Thu Jun 29, 2017 2:57 am
by jyoung
Is there a way to get the user profile for the logged in user on the client side?

In the LOGON IIP, I set the "UserProfileToCheck" to a known user with the proper authorities. I need to get that profile back in another component.

I store that profile in the Persistent_ApplicationString1 so I could go to the server and have it send it back down, but it seems like I should be able to get it from the framework itself on the client.

This post http://vlforum.lansa.com.au/viewtopic.p ... 150&p=1929 seems to show that it can be done, but those ideas always return the user name that was entered, not the UserProfileToCheck.

For example in the Logon IIP I set the UserProfileToCheck to ADMIN_USR

Code: Select all

mthroutine name(CheckUserCredentials) options(*REDEFINE *RETURNS_MESSAGES)

#UserProfiletoCheck := ADMIN_USR

endroutine
Now when I try to get that profile with one of the following

Code: Select all

#STD_STRNG := #avFrameworkManager.avLoggedOnUser
#STD_STRNG := #uSystem.FrameworkLoggedOnVisibleUserProfile
#STD_STRNG := #uSystem.FrameworkPlatformU
It returns the user name that was used to log in, NOT ADMIN_USR.

Re: VLF-ONE Get Active Profile On Client Side

Posted: Thu Jun 29, 2017 8:00 am
by MarkD
Unfortunately the user profile used for the authority check never leaves the server.
On the visible user profile gets sent back to the client.

Maybe you could create a server module that gets run after the logon, maybe in IIP method avMainWindowReady.
It could pick up the group name from the persistent application string and return it for storage as a property in your custom framework manager.
Then it would be available everywhere in the client from then on.

Re: VLF-ONE Get Active Profile On Client Side

Posted: Thu Jun 29, 2017 11:07 pm
by jyoung
Good to know, thanks Mark!