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() |
| Modifier and Type | Method and Description |
|---|---|
User |
clearCache()
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) |
User |
isAuthorised(String authority,
Handler<AsyncResult<Boolean>> resultHandler)
Is the user authorised to
|
int |
readFromBuffer(int pos,
Buffer buffer) |
void |
writeToBuffer(Buffer buff) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprincipal, setAuthProviderpublic User isAuthorised(String authority, Handler<AsyncResult<Boolean>> resultHandler)
UserisAuthorised in interface Userauthority - 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()
UserclearCache in interface Userpublic void writeToBuffer(Buffer buff)
writeToBuffer in interface io.vertx.core.shareddata.impl.ClusterSerializablepublic int readFromBuffer(int pos,
Buffer buffer)
readFromBuffer in interface io.vertx.core.shareddata.impl.ClusterSerializableprotected abstract void doIsPermitted(String permission, Handler<AsyncResult<Boolean>> resultHandler)
Copyright © 2015. All rights reserved.