io.vertx.rxjava.ext.auth.common

## Class User

- java.lang.Object
- - io.vertx.rxjava.ext.auth.common.User

-     public class User
      extends Object

  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.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `User(User delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method 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.
    `Object` | `getDelegate()`
    `User` | `hasPermission(String permission, Handler<AsyncResult<Boolean>> resultHandler)` Does the user have the specified permission?
    `rx.Observable<Boolean>` | `hasPermissionObservable(String permission)` Does the user have the specified permission?
    `User` | `hasPermissions(Set<String> permissions, Handler<AsyncResult<Boolean>> resultHandler)` Does the user have all the specified permissions?
    `rx.Observable<Boolean>` | `hasPermissionsObservable(Set<String> permissions)` Does the user have all the specified permissions?
    `User` | `hasRole(String role, Handler<AsyncResult<Boolean>> resultHandler)` Does the user have the specified role?
    `rx.Observable<Boolean>` | `hasRoleObservable(String role)` Does the user have the specified role?
    `User` | `hasRoles(Set<String> roles, Handler<AsyncResult<Boolean>> resultHandler)` Does the user have all the specified roles?
    `rx.Observable<Boolean>` | `hasRolesObservable(Set<String> roles)` Does the user have all the specified roles?
    `static User` | `newInstance(User arg)`
    `JsonObject` | `principal()` Get the underlying principal for the User.
    `void` | `setAuthProvider(AuthProvider authProvider)` Set the auth provider for the User.

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

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

- - ### Constructor Detail

    - #### User

          public User(User delegate)

  - ### Method Detail

    - #### getDelegate

          public Object getDelegate()

    - #### hasRole

          public User hasRole(String role,
                              Handler<AsyncResult<Boolean>> resultHandler)

      Does the user have the specified role?
      Parameters:
        `role` - the role
        `resultHandler` - handler that will be called with an `AsyncResult` containing the value `true` if the they have the role or `false` otherwise.
      Returns:
        the User to enable fluent use

    - #### hasRoleObservable

          public rx.Observable<Boolean> hasRoleObservable(String role)

      Does the user have the specified role?
      Parameters:
        `role` - the role
      Returns:

    - #### hasPermission

          public User hasPermission(String permission,
                                    Handler<AsyncResult<Boolean>> resultHandler)

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

    - #### hasPermissionObservable

          public rx.Observable<Boolean> hasPermissionObservable(String permission)

      Does the user have the specified permission?
      Parameters:
        `permission` - the permission
      Returns:

    - #### hasRoles

          public User hasRoles(Set<String> roles,
                               Handler<AsyncResult<Boolean>> resultHandler)

      Does the user have all the specified roles?
      Parameters:
        `roles` - the set of roles
        `resultHandler` - handler that will be called with an `AsyncResult` containing the value `true` if the they have all the roles or `false` otherwise.
      Returns:
        the User to enable fluent use

    - #### hasRolesObservable

          public rx.Observable<Boolean> hasRolesObservable(Set<String> roles)

      Does the user have all the specified roles?
      Parameters:
        `roles` - the set of roles
      Returns:

    - #### hasPermissions

          public User hasPermissions(Set<String> permissions,
                                     Handler<AsyncResult<Boolean>> resultHandler)

      Does the user have all the specified permissions?
      Parameters:
        `permissions` - the set of permissions
        `resultHandler` - handler that will be called with an `AsyncResult` containing the value `true` if the they have all the permissions or `false` otherwise.
      Returns:
        the User to enable fluent use

    - #### hasPermissionsObservable

          public rx.Observable<Boolean> hasPermissionsObservable(Set<String> permissions)

      Does the user have all the specified permissions?
      Parameters:
        `permissions` - the set of permissions
      Returns:

    - #### clearCache

          public 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

    - #### principal

          public JsonObject 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:

    - #### setAuthProvider

          public 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

    - #### newInstance

          public static User newInstance(User arg)

Copyright © 2015. All rights reserved.