Promotic
WikipediaLinkedInYoutubeTwitterFacebook

PmUser - Deatiled object description

See: The PmUser object
 
This object is available for example:
- in the Pm.LoggedUser property
- in onUserLogonEnd, onUserLogoff and onPageModify events (in the pEvent.User parameter)
- in onUserItemAction and onStateChange events (in the pEvent.Context.User parameter)
- in the user methods of the PmaPanel object (in the pContext.User parameter)
 
During the authentication process the entered authentication data of the local or network user is compared with the list of defined users (see the "PmaRoot > Users" page). The first defined user found, whose definition corresponds with the entered authentication data, will be used in the user right evaluation system (see Description of the Permission page) and the specified data will be used by the PmUser object.
 
The private user data:

In events onUserLogonEnd, onUserLogoff and onPageModify or in user methods of the PmaPanel object it is possible to the specific user (PmUser object) assign and read the assistant data named by the methods PmUser.SetPrivateData and PmUser.GetPrivateData. This is particullary useful for network users, enabling to store the different states for each logged user. This is handy especially for network users, because this way it is possible to save different status for each logged user. Then it is, for example, possible in the Web panel to have the "UP - Binding to the logged user property" data binding linked to GetPrivateData in order to display in the Pmg object different values for each user.

 
Examples of usage the private data:
Setting the private data by the server:
In the onUserLogonEnd event, the "TEST" user will get the private data identified as dt0 with the value of 7, otherwise 0.
JavaScriptVBScriptSelect and copy to clipboard

if (pEvent.User.Name == "TEST")
pEvent.User.SetPrivateData("dt0", 7);
else
pEvent.User.SetPrivateData("dt0", 0);
Setting the private data by the client:
In the onButtonUp event of the PmgButton object the "SettingData" panel designer's method is called with two paramaters.
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.Methods.SettingData("dt0", 7);
 
The "SettingData" method has two parameters sId and vVal. The logged-in user entered the value 7 with identificator "dt0" into his private data.
JavaScriptVBScriptSelect and copy to clipboard

pContext.User.SetPrivateData(sId, vVal);
Reading the private data by the client:
Reading the privatedata can then be done by the "UP - Binding to the logged user property" data binding connected to GetPrivateData. Or for example by calling the designer's method "GettingData" of panel from the Pmg object with the parameter:
JavaScriptVBScriptSelect and copy to clipboard

if (pMe.PmPanel.Methods.GettingData("dt0") == 7)
//...
The "GettingData" panel method has the sId parameter and returns the value.
JavaScriptVBScriptSelect and copy to clipboard

return pContext.User.GetPrivateData(sId);

History:
Pm7.02.00: Created
PROMOTIC 9.0.4 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice