How to determine if you have write permissions on a tag?

Disclaimer: I haven’t looked into this at all… a colleague just asked.

How can you determine if the current user has write access to a tag that has security permission defined on it?

He wants to display to the user that a component cannot be used if they don’t have write permissions to the tag it’s displaying.

Nevermind, he found it. Tag property “canWrite”

PS. this was only added in v8.1.8

Is the canWrite property set at the gateway or is local to a perspective session?

If multiple sessions are open, how will this property work?
I'm looking to use this as a graphical indicator to tell an operator if they have sufficient security level to control a tag. I'm worried if there are 2+ sessions open that this property will take the highest logged in user.

CanWrite is session-based.

E.g. if a session has a user logged in with the "Engineer" role and the tag's write permissions require the "Engineer" role, then the user in that session will have access. If another session has a user logged in without that role, they won't have write access to that tag.