Package: io.vertx.groovy.ext.auth.common

## [Groovy] Class User

- io.vertx.groovy.ext.auth.common.User

- Represents an authenticate User and contains operations to authorise the user, using a role/permission based model.

  Please consult the documentation for a detailed explanation.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `io.vertx.ext.auth.User` | `delegate`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `User (io.vertx.ext.auth.User delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `User` | `clearCache()` The User object will cache any roles or permissions that it knows it has to avoid hitting the underlying auth provider each time.
    `java.lang.Object` | `getDelegate()`
    `User` | `hasPermission(java.lang.String permission, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>> resultHandler)` Does the user have the specified permission?
    `java.util.Map<java.lang.String, java.lang.Object>` | `principal()` Get the underlying principal for the User.
    `void` | `setAuthProvider(AuthProvider authProvider)` Set the auth provider for the User.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Property Detail

    - #### final io.vertx.ext.auth.User delegate

  - ### Constructor Detail

    - #### User(io.vertx.ext.auth.User delegate)

  - ### Method Detail

    - #### User clearCache()

      The User object will cache any roles or permissions that it knows it has to avoid hitting the underlying auth provider each time. Use this method if you want to clear this cache.

      Returns:
        the User to enable fluent use

    - #### java.lang.Object getDelegate()

    - #### User hasPermission(java.lang.String permission, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>> resultHandler)

      Does the user have the specified permission?

      Returns:
        the User to enable fluent use
      Parameters:
        `permission` - the permission
        `resultHandler` - handler that will be called with an io.vertx.core.AsyncResult containing the value `true` if the they have the permission or `false` otherwise.

    - #### java.util.Map<java.lang.String, java.lang.Object> principal()

      Get the underlying principal for the User. What this actually returns depends on the implementation. For a simple user/password based auth, it's likely to contain a JSON object with the following structure:

             {
               "username", "tim"
             }

      Returns:

    - #### void setAuthProvider(AuthProvider authProvider)

      Set the auth provider for the User. This is typically used to reattach a detached User with an AuthProvider, e.g. after it has been deserialized.

      Parameters:
        `authProvider` - the AuthProvider - this must be the same type of AuthProvider that originally created the User