# User
Class
## About
`User` provides information about an authenticated collaboration participant. Its properties are read-only, except that setting `Access` to `Read` or `Edit` on a user returned by `Server.Sessions` changes that live session. Before a document is opened, it identifies the connection and has an empty `DocumentID`. In a shared document, the editor updates its pointer, selection, and editing properties as live activity messages arrive.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| SelectedNodeIDs | (None) | String | Returns a copy of the stable node identifiers currently selected by the collaborator. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Access | GraffitiProEditor.CollaborationAccess | (None) | Returns the access level granted to the authenticated connection or current document. |
| CollaboratorID | String | (None) | Returns the opaque, session-unique identifier assigned to the collaborator. |
| ConnectedAt | DateTime | (None) | Returns the time at which the authenticated connection or document session began, or Nil if unavailable. |
| DocumentID | String | (None) | Returns the current shared document identifier, or an empty string when the user has authenticated but has not opened a document. |
| IsEditing | Boolean | (None) | Returns whether the collaborator is currently editing a node. |
| LastPresenceAt | DateTime | (None) | Returns the time at which the most recent presence update was received, or Nil if none has arrived. |
| PointerNodeID | String | (None) | (None) |
| PointerNodeX | Double | (None) | (None) |
| PointerNodeY | Double | (None) | (None) |
| PointerX | Double | (None) | Returns the most recent pointer X coordinate relative to the editor. |
| PointerY | Double | (None) | Returns the most recent pointer Y coordinate relative to the editor's document. |
| SelectedNodeID | String | (None) | Returns the stable identifier of the collaborator's primary selected node, or an empty string. |
| SelectionLength | Integer | (None) | Returns the length of the collaborator's current text selection. |
| SelectionStart | Integer | (None) | Returns the start offset of the collaborator's current text selection. |
| UserName | String | (None) | Returns the authenticated display name of the collaborator. |
## Notes
### Lifecycle
The server creates a stable `User` after connection authentication and supplies it to `Server.RequestDocuments`. At that point, `CollaboratorID`, `UserName`, `Access`, and `ConnectedAt` describe the authenticated connection, while `DocumentID` is empty.
An editor also retains a `User` while a participant stays in the current document session. `CollaborationUserConnected` supplies the new object, `CollaborationUserDisconnected` supplies the departing object, and `Collaborators()` returns the current objects. Do not retain a user after the disconnected event unless historical information is required.
`ConnectedAt` is the time at which the server says the user joined the document. `LastPresenceAt` is `Nil` until pointer, selection, or editing information has been received. These activity properties contain the newest received values and may no longer be current when `LastPresenceAt` is old.
The hidden `Constructor(json As JSONItem)` and `ToJSON() As JSONItem` members let the collaboration system convert users to and from protocol JSON without making JSON part of the normal public API. `ToJSON` always returns a new object that callers may safely modify.
## Examples
Use `Editor.Collaborators()` to populate a collaborator list and retain the returned objects if the interface should reflect subsequent presence updates.
### Listing Collaborators
```xojo
For Each user As GraffitiProEditor.Network.User In Editor.Collaborators
System.DebugLog(user.UserName + " (" + user.Access.ToString + ")")
Next
```