com.atlassian.crucible.spi.services.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.Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Can the plugin do a privleged action
| |||||||||||
Are we allowed to impersonate this user?
| |||||||||||
This method is deprecated.
use
doAsUser(com.atlassian.crucible.spi.PluginId, String, Operation) for impersonating a user
or doPrivilegedAction(com.atlassian.crucible.spi.PluginId, Operation) for a privileged mode
| |||||||||||
Execute an Operation as a particular user.
| |||||||||||
Execute an Operation in a privileged mode.
| |||||||||||
Get the current user, if any.
| |||||||||||
Get the name of the default user configured for this plugin, if any
|
Can the plugin do a privleged action
id | the PluginId of the calling plugin |
---|
true
if the plugin can to a privileged action, false
otherwise
Are we allowed to impersonate this user?
id | the PluginId of the calling plugin. |
---|---|
userName | a String naming the user we wish to impersonate. |
true
if we are allowed to impersonate this user, false
otherwise
This method is deprecated.
use doAsUser(com.atlassian.crucible.spi.PluginId, String, Operation)
for impersonating a user
or doPrivilegedAction(com.atlassian.crucible.spi.PluginId, Operation)
for a privileged mode
Execute an Operation as the default user. If the current user is *not* anonymous, this operation will be performed as the current user. If the current user *is* anonymous, this Operation will be performed as the default user configured for this plugin. If no default user is configured for this plugin, and there is no current user, the operation will be performed as the anonymous user.
id | the PluginId of the calling plugin. |
---|---|
operation | the Operation to perform. |
if the operation throws an exception while executing. | |
Throwable |
Execute an Operation as a particular user.
id | the PluginId of the calling plugin. |
---|---|
userName | a String naming the user to impersonate. |
operation | the Operation to perform. |
when thrown by Operation.perform() | |
NotPermittedException | when the given plugin is not allowed to impersonate the given user. |
Throwable |
Execute an Operation in a privileged mode. Use this if your plugin requires access to data without having the context of a user. This is useful when running background tasks or listening to events. Use with precaution though, as you may expose a security vulnerability in your plugin and/or FishEye & Crucible
id | the PluginId of the calling plugin. |
---|---|
operation | the Operation to perform. |
if the operation throws an exception while executing. | |
Throwable |
Get the current user, if any.
id | the PluginId of the calling plugin. |
---|
Get the name of the default user configured for this plugin, if any
id | the PluginId of the calling plugin. |
---|