io.vertx.ext.auth

## Class AbstractUser

- java.lang.Object
- - io.vertx.ext.auth.AbstractUser

- All Implemented Interfaces:
    io.vertx.core.shareddata.impl.ClusterSerializable, User

  Deprecated.
  in 4.0 this class will not be used

      @Deprecated
      public abstract class AbstractUser
      extends Object
      implements User, io.vertx.core.shareddata.impl.ClusterSerializable

  Useful base class for implementing a User object.

  This class handles the caching logic so you can concentrate on the actual authorisation logic.

  Just implement the abstract methods in your concrete sub-class.

  Author:
    Tim Fox

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractUser()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cachePermission(String authority)` Deprecated.
    `User` | `clearCache()` Deprecated. The User object will cache any authorities that it knows it has to avoid hitting the underlying auth provider each time.
    `protected abstract void` | `doIsPermitted(String permission, Handler<AsyncResult<Boolean>> resultHandler)` Deprecated.
    `User` | `isAuthorized(String authority, Handler<AsyncResult<Boolean>> resultHandler)` Deprecated. Is the user authorised to
    `int` | `readFromBuffer(int pos, Buffer buffer)` Deprecated.
    `void` | `writeToBuffer(Buffer buff)` Deprecated.

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

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

    - ### Methods inherited from interface io.vertx.ext.auth.User

      `isAuthorised, principal, setAuthProvider`

- - ### Constructor Detail

    - #### AbstractUser

          public AbstractUser()

      Deprecated.

  - ### Method Detail

    - #### isAuthorized

          public User isAuthorized(String authority,
                                   Handler<AsyncResult<Boolean>> resultHandler)

      Deprecated.
      Description copied from interface: `User`
      Is the user authorised to
      Specified by:
        `isAuthorized` in interface `User`
      Parameters:
        `authority` - the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.
        `resultHandler` - handler that will be called with an `AsyncResult` containing the value `true` if the they has the authority or `false` otherwise.
      Returns:
        the User to enable fluent use

    - #### clearCache

          public User clearCache()

      Deprecated.
      Description copied from interface: `User`
      The User object will cache any authorities that it knows it has to avoid hitting the underlying auth provider each time. Use this method if you want to clear this cache.
      Specified by:
        `clearCache` in interface `User`
      Returns:
        the User to enable fluent use

    - #### writeToBuffer

          public void writeToBuffer(Buffer buff)

      Deprecated.
      Specified by:
        `writeToBuffer` in interface `io.vertx.core.shareddata.impl.ClusterSerializable`

    - #### readFromBuffer

          public int readFromBuffer(int pos,
                                    Buffer buffer)

      Deprecated.
      Specified by:
        `readFromBuffer` in interface `io.vertx.core.shareddata.impl.ClusterSerializable`

    - #### cachePermission

          public boolean cachePermission(String authority)

      Deprecated.

    - #### doIsPermitted

          protected abstract void doIsPermitted(String permission,
                                                Handler<AsyncResult<Boolean>> resultHandler)

      Deprecated.

Copyright © 2022 Eclipse. All rights reserved.