|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.core.service.RunAsUserCommand
public class RunAsUserCommand
An experimental command for running services as another user. NOT CURRENTLY UNIT-TESTED
Constructor Summary | |
---|---|
RunAsUserCommand(ConfluenceUser userToRunAs,
ServiceCommand delegate)
|
|
RunAsUserCommand(com.atlassian.user.User userToRunAs,
ServiceCommand delegate)
Deprecated. since 5.2. Use RunAsUserCommand(com.atlassian.confluence.user.ConfluenceUser, ServiceCommand) instead. |
Method Summary | |
---|---|
void |
execute()
Execute the command. |
java.util.Collection |
getValidationErrors()
Gets the list of errors that are preventing the command from being executed. |
boolean |
isAuthorized()
Determine if the current user is authorized to execute this command. |
boolean |
isValid()
Determine if the command is in a valid state to be executed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RunAsUserCommand(ConfluenceUser userToRunAs, ServiceCommand delegate)
@Deprecated public RunAsUserCommand(com.atlassian.user.User userToRunAs, ServiceCommand delegate)
RunAsUserCommand(com.atlassian.confluence.user.ConfluenceUser, ServiceCommand)
instead.
Method Detail |
---|
public boolean isValid()
ServiceCommand
ServiceCommand.execute()
is be expected to perform successfully (unless prevented by some system
error). If this method returns false, execute
will fail with a
NotValidException
.
This method should be called after checking ServiceCommand.isAuthorized()
. If the current user is not
authorized to execute this command, this method must throw a NotAuthorizedException
.
If this method returns false, then ServiceCommand.getValidationErrors()
must return a non-empty list of
errors explaining why the command was not valid. If this method returns true, the collection returned by
getValidationErrors()
must be empty.
isValid
in interface ServiceCommand
public java.util.Collection getValidationErrors()
ServiceCommand
ServiceCommand.isValid()
will always return an empty collection.
getValidationErrors
in interface ServiceCommand
ValidationError
objects describing why command validation failedpublic boolean isAuthorized()
ServiceCommand
AuthenticatedUserThreadLocal.get()
.
isAuthorized
in interface ServiceCommand
public void execute()
ServiceCommand
execute
in interface ServiceCommand
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |