# system.kanoa.operators.operatorLogin(sessionInfo, userId)

Logs an operator into an asset by inserting an open mes.operatorAssetSession row. There is no separate operator identity - sessionInfo['userId'] is the sec.user being
logged in, FK'd straight into sec.user. It can differ from the outer userId param (the actor performing the action, used for createdBy/changedBy audit) - e.g. a
supervisor badging an operator in at a shared kiosk session.
A filtered unique index blocks a duplicate open session for the same user+asset pair - if the user is already logged into this asset, the insert fails and this returns (None, message).
By default (allowMultiSession not True), any OTHER open session this user has on a different asset is closed first (tStamp used as the logoutTStamp), so badging into a new
line implicitly logs them out of the old one - the common case, and it avoids a user silently appearing 'logged in' on two lines at once because they forgot to badge out.
Pass allowMultiSession=True to opt out (e.g. a floater/lead genuinely covering two assets).

---
### Parameters
**sessionInfo** `Dictionary`<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - allowMultiSession</td><td>Boolean</td><td>optional, default False</td></tr>	
 	<tr><td> - assetId</td><td>Integer</td><td></td></tr>	
 	<tr><td> - tStamp</td><td>String</td><td></td></tr>	
 	<tr><td> - userId</td><td>Integer</td><td>the sec.user being logged in</td></tr>	
 	<tr><td> - workOrderId</td><td>Integer</td><td>optional</td></tr>	
	</tbody>
</table>

**userId** `Integer`: the actor performing this action (createdBy/changedBy)<br />

---
### Returns
**operatorAssetSessionId** `Integer` the new session's id on success, None on failure<br />
**message** `String` None on success, an error message on failure<br />

---
### Example
```python
sessionInfo = {
	'userId': 5,
	'assetId': 4,
	'workOrderId': None,
	'tStamp': system.date.now(),
	'allowMultiSession': False
}
userId = 12
operatorAssetSessionId, message = system.kanoa.operators.operatorLogin(sessionInfo, userId)
```
