|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ImpersonationService
Plugins may wish to perform operations as particular users.
This interface allows them to discover what they are allowed to do, and to choose which user they want to operate as.
Method Summary | ||
---|---|---|
boolean |
canImpersonate(PluginId id,
java.lang.String userName)
Are we allowed to impersonate this user? |
|
|
doAsDefaultUser(PluginId id,
Operation<T,E> operation)
Execute an Operation as the default user. |
|
|
doAsUser(PluginId id,
java.lang.String userName,
Operation<T,E> operation)
Execute an Operation as a particular user. |
|
UserData |
getCurrentUser(PluginId id)
Get the current user, if any. |
|
UserData |
getDefaultUser(PluginId id)
Get the name of the default user configured for this plugin, if any |
Method Detail |
---|
<T,E extends java.lang.Throwable> T doAsUser(PluginId id, java.lang.String userName, Operation<T,E> operation) throws E extends java.lang.Throwable
T
- the Type returned by the operation.E
- the type of Exception thrown by the Operation.id
- the PluginId of the calling plugin.userName
- a String naming the user to impersonate.operation
- the Operation to perform.
E
- when thrown by Operation.perform()
NotPermittedException
- when the given plugin is not allowed to impersonate the given user.
E extends java.lang.Throwable
<T,E extends java.lang.Throwable> T doAsDefaultUser(PluginId id, Operation<T,E> operation) throws E extends java.lang.Throwable
T
- the Type returned by the operation.E
- the type of Exception thrown by the Operation.id
- the PluginId of the calling plugin.operation
- the Operation to perform.
E
E extends java.lang.Throwable
boolean canImpersonate(PluginId id, java.lang.String userName)
id
- the PluginId of the calling plugin.userName
- a String naming the user we wish to impersonate.
UserData getDefaultUser(PluginId id)
id
- the PluginId of the calling plugin.
UserData getCurrentUser(PluginId id) throws ServerException
id
- the PluginId of the calling plugin.
ServerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |