public class MockSimpleAuthenticationContext extends Object implements JiraAuthenticationContext
| Constructor and Description |
|---|
MockSimpleAuthenticationContext(ApplicationUser user,
Locale locale,
I18nHelper helper) |
MockSimpleAuthenticationContext(com.atlassian.crowd.embedded.api.User user) |
MockSimpleAuthenticationContext(com.atlassian.crowd.embedded.api.User user,
Locale locale) |
MockSimpleAuthenticationContext(com.atlassian.crowd.embedded.api.User user,
Locale locale,
I18nHelper helper) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearLoggedInUser()
Clears any logged in user from authentication scope.
|
static MockSimpleAuthenticationContext |
createNoopContext(ApplicationUser user) |
static MockSimpleAuthenticationContext |
createNoopContext(com.atlassian.crowd.embedded.api.User user) |
I18nHelper |
getI18nBean()
Useful for localisation of messages.
|
I18nHelper |
getI18nHelper()
Useful for localisation of messages.
|
Locale |
getLocale()
Get the users locale.
|
com.atlassian.crowd.embedded.api.User |
getLoggedInUser()
Returns the currently logged in User.
|
OutlookDate |
getOutlookDate()
Method used to get a nice representation of a date using a user's locale.
|
String |
getText(String key) |
ApplicationUser |
getUser()
Returns the currently logged in User.
|
boolean |
isLoggedInUser()
Returns a boolean indicating whether there is a currently logged in user.
|
MockSimpleAuthenticationContext |
setLocale(Locale locale) |
void |
setLoggedInUser(ApplicationUser user)
This is used in places like Jelly where we need to switch the identity of a user during execution.
|
void |
setLoggedInUser(com.atlassian.crowd.embedded.api.User user)
This id usedin places like Jelly where we need to switch the identity of a user during execution.
|
public MockSimpleAuthenticationContext(com.atlassian.crowd.embedded.api.User user)
public MockSimpleAuthenticationContext(com.atlassian.crowd.embedded.api.User user,
Locale locale)
public MockSimpleAuthenticationContext(com.atlassian.crowd.embedded.api.User user,
Locale locale,
I18nHelper helper)
public MockSimpleAuthenticationContext(ApplicationUser user, Locale locale, I18nHelper helper)
public com.atlassian.crowd.embedded.api.User getLoggedInUser()
JiraAuthenticationContextgetLoggedInUser in interface JiraAuthenticationContextpublic ApplicationUser getUser()
JiraAuthenticationContextcom.atlassian.crowd.embedded.api.User.
This method had previously been deprecated and has been reused to return an ApplicationUser instead. That
class has different semantics for Object.equals(Object) and therefore does not extend the User
class. This means that the 6.0 version is not binary or source compatible with earlier versions when this method
is used.getUser in interface JiraAuthenticationContextApplicationUser, or nullpublic boolean isLoggedInUser()
JiraAuthenticationContextisLoggedInUser in interface JiraAuthenticationContextpublic Locale getLocale()
JiraAuthenticationContextgetLocale in interface JiraAuthenticationContextpublic OutlookDate getOutlookDate()
JiraAuthenticationContextgetOutlookDate in interface JiraAuthenticationContextOutlookDatepublic String getText(String key)
getText in interface JiraAuthenticationContextkey - the text keypublic I18nHelper getI18nHelper()
JiraAuthenticationContextgetI18nHelper in interface JiraAuthenticationContextI18nHelperpublic I18nHelper getI18nBean()
JiraAuthenticationContextgetI18nBean in interface JiraAuthenticationContextI18nHelperpublic void setLoggedInUser(com.atlassian.crowd.embedded.api.User user)
JiraAuthenticationContextsetLoggedInUser in interface JiraAuthenticationContextuser - the currently logged in userpublic void setLoggedInUser(ApplicationUser user)
JiraAuthenticationContextsetLoggedInUser in interface JiraAuthenticationContextuser - the currently logged in userpublic void clearLoggedInUser()
JiraAuthenticationContextclearLoggedInUser in interface JiraAuthenticationContextpublic MockSimpleAuthenticationContext setLocale(Locale locale)
public static MockSimpleAuthenticationContext createNoopContext(com.atlassian.crowd.embedded.api.User user)
public static MockSimpleAuthenticationContext createNoopContext(ApplicationUser user)
Copyright © 2002-2016 Atlassian. All Rights Reserved.