User.create(JsonObject)
.@Deprecated public abstract class AbstractUser extends Object implements User, io.vertx.core.shareddata.impl.ClusterSerializable
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.
Constructor and Description |
---|
AbstractUser()
Deprecated.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attributes, authorizations, containsKey, create, create, expired, expired, fromName, fromToken, get, isAuthorized, isAuthorized, isAuthorized, principal, setAuthProvider
public User isAuthorized(String authority, Handler<AsyncResult<Boolean>> resultHandler)
User
isAuthorized
in interface User
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.public User clearCache()
User
clearCache
in interface User
public void writeToBuffer(Buffer buff)
writeToBuffer
in interface io.vertx.core.shareddata.impl.ClusterSerializable
public int readFromBuffer(int pos, Buffer buffer)
readFromBuffer
in interface io.vertx.core.shareddata.impl.ClusterSerializable
public boolean cachePermission(String authority)
protected abstract void doIsPermitted(String permission, Handler<AsyncResult<Boolean>> resultHandler)
Copyright © 2021 Eclipse. All rights reserved.