Perspective v8.1.13
Active Directory Hybrid w/ Internal Roles
Users are queried automatically and all user attributes are received correctly.
I would like to use a different user attribute for the User Ack column in the alarm status table. Our user names are clock numbers in AD and is what we use to authenticate/login. The alarm status table provides a column to show who acknowledged an alarm, but our clock number is displayed instead of the persons name. This makes it difficult to determine who acknowledged the alarm or added notes. I.e., âto654y3â is an example of a clock number. I would rather show the userâs first name or first and last.
I didnât see any obvious setting and I didnât want to try changing the pointer to the username from LDAP in case I got locked out. I also want to continue using our clock number as the login username as that is what our other systems require as well. Any ideas?
Thank you for your time.
In Designer click Perspective in the Project Browser and check what's available in the SESSION PROPS under user. My Active Directory hybrid user source gives me,
id
userName
firstName
lastName
email
roles (an array)
If your name shows up there then you can use it in your application, session.props.user.firstName etc.
I didnât want to try changing the pointer to the username from LDAP in case I got locked out.
I highly recommend that you use a soft failover to the default user source and leave the administrator user (or another) that can be used if the AD user source fails.
Config | Security | Users, Roles | Edit ...
Session properties will only provide information on the current user. The OP wants to see the first/last name of whomever acked the alarm. I donât know if this possible, but session props arenât the answer.
Not to my mind. Would require changing what happens at ack time to capture more information about the user in order to display it later. Not simple. Probably worth making a feature request on ideas.inductiveautomation.com.
I think it is possible, but it will take some work.
I would create a custom property on every tag, alarm section, that describes the full name, I will call it Actor (This is the tedious part because you will have to create this for every tag with alarm). A fast way might be to export the json tags, modify it and import again.
Create an script project that takes the user name as parameter (this is the none trivial part).
Use a expression binding over that custom property using {ackUserName} as the parameter of runScript() calling the created script.
I didnât use AD for this, instead pure internal user source. But, this might help anyway.
I will share the script but this is based on the idea that you can access the fullname from the user source, Iâve never had the chance to test AD Hybrid.
Finally, If you hit, in the alarm table
you will see the Actor property under On Ack section
@jespinmartin1, thank you for showing me this trick. I did not know that custom properties would show up in the alarm details table.
I did get this working and while not as convenient as remapping the column value, we can see the name of the user without having to go lookup cryptic clock numbers.
Thank you!