VLF-ONE Get Active Profile On Client Side

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLF-ONE Get Active Profile On Client Side

Post 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.
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE Get Active Profile On Client Side

Post 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.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE Get Active Profile On Client Side

Post by jyoung »

Good to know, thanks Mark!
Post Reply