Package com.logicaldoc.core.automation

# Class SecurityTool

java.lang.Object
com.logicaldoc.core.automation.SecurityTool

public class SecurityTool extends Object
Utility methods to handle some security related operations from within the Automation

Since:
  8.4
Author:
  Meschieri - LogicalDOC

## Constructor Summary

Constructors
Constructor
Description
`SecurityTool()`

## Method Summary

Modifier and Type
Method
Description
`Session`
`getSession(String sid)`
Retrieves a session by it's identifier
`User`
`getUser(long userId)`
Retrieves a user object
`User`
`getUser(String username)`
Retrieves a user object

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SecurityTool

public SecurityTool()

## Method Details

### getUser

public User getUser(String username)
Retrieves a user object

Parameters:
  `username` - the username
Returns:
  the user object

### getUser

public User getUser(long userId)
Retrieves a user object

Parameters:
  `userId` - the user ID
Returns:
  the user object

### getSession

public Session getSession(String sid)
Retrieves a session by it's identifier

Parameters:
  `sid` - identifier of the session
Returns:
  the session that matches the identifier