Class ConfluenceUserManager
- java.lang.Object
-
- com.atlassian.sal.confluence.user.ConfluenceUserManager
-
- All Implemented Interfaces:
com.atlassian.sal.api.user.UserManager
public class ConfluenceUserManager extends Object implements com.atlassian.sal.api.user.UserManager
Authenticates a user against UserAccessor in Confluence.
-
-
Constructor Summary
Constructors Constructor Description ConfluenceUserManager(UserAccessor userAccessor, com.atlassian.crowd.embedded.api.CrowdService crowdService, PermissionManager permissionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticate(String username, String password)
Iterable<String>
findGroupNamesByPrefix(String prefix, int startIndex, int maxResults)
@Nullable com.atlassian.sal.api.user.UserProfile
getRemoteUser()
@Nullable com.atlassian.sal.api.user.UserProfile
getRemoteUser(javax.servlet.http.HttpServletRequest httpServletRequest)
@Nullable com.atlassian.sal.api.user.UserKey
getRemoteUserKey()
@Nullable com.atlassian.sal.api.user.UserKey
getRemoteUserKey(javax.servlet.http.HttpServletRequest httpServletRequest)
String
getRemoteUsername()
String
getRemoteUsername(javax.servlet.http.HttpServletRequest request)
@Nullable com.atlassian.sal.api.user.UserProfile
getUserProfile(@Nullable com.atlassian.sal.api.user.UserKey userKey)
com.atlassian.sal.api.user.UserProfile
getUserProfile(String username)
boolean
isAdmin(@Nullable com.atlassian.sal.api.user.UserKey userKey)
boolean
isAdmin(String username)
boolean
isSystemAdmin(@Nullable com.atlassian.sal.api.user.UserKey userKey)
boolean
isSystemAdmin(String username)
boolean
isUserInGroup(@Nullable com.atlassian.sal.api.user.UserKey userKey, @Nullable String groupName)
boolean
isUserInGroup(String username, String group)
Returns whether the user is in the specify groupConfluenceUser
resolve(String username)
-
-
-
Constructor Detail
-
ConfluenceUserManager
public ConfluenceUserManager(UserAccessor userAccessor, com.atlassian.crowd.embedded.api.CrowdService crowdService, PermissionManager permissionManager)
-
-
Method Detail
-
getRemoteUsername
public String getRemoteUsername()
- Specified by:
getRemoteUsername
in interfacecom.atlassian.sal.api.user.UserManager
-
getRemoteUser
public @Nullable com.atlassian.sal.api.user.UserProfile getRemoteUser()
- Specified by:
getRemoteUser
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
getRemoteUserKey
public @Nullable com.atlassian.sal.api.user.UserKey getRemoteUserKey()
- Specified by:
getRemoteUserKey
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
isSystemAdmin
public boolean isSystemAdmin(String username)
- Specified by:
isSystemAdmin
in interfacecom.atlassian.sal.api.user.UserManager
-
isSystemAdmin
public boolean isSystemAdmin(@Nullable com.atlassian.sal.api.user.UserKey userKey)
- Specified by:
isSystemAdmin
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
authenticate
public boolean authenticate(String username, String password)
- Specified by:
authenticate
in interfacecom.atlassian.sal.api.user.UserManager
-
isUserInGroup
public boolean isUserInGroup(String username, String group)
Returns whether the user is in the specify group- Specified by:
isUserInGroup
in interfacecom.atlassian.sal.api.user.UserManager
- Parameters:
username
- The username to checkgroup
- The group to check- Returns:
- True if the user is in the specified group
-
isUserInGroup
public boolean isUserInGroup(@Nullable com.atlassian.sal.api.user.UserKey userKey, @Nullable String groupName)
- Specified by:
isUserInGroup
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
getRemoteUsername
public String getRemoteUsername(javax.servlet.http.HttpServletRequest request)
- Specified by:
getRemoteUsername
in interfacecom.atlassian.sal.api.user.UserManager
-
getRemoteUser
public @Nullable com.atlassian.sal.api.user.UserProfile getRemoteUser(javax.servlet.http.HttpServletRequest httpServletRequest)
- Specified by:
getRemoteUser
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
getRemoteUserKey
public @Nullable com.atlassian.sal.api.user.UserKey getRemoteUserKey(javax.servlet.http.HttpServletRequest httpServletRequest)
- Specified by:
getRemoteUserKey
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
resolve
public ConfluenceUser resolve(String username)
- Specified by:
resolve
in interfacecom.atlassian.sal.api.user.UserManager
-
findGroupNamesByPrefix
public Iterable<String> findGroupNamesByPrefix(String prefix, int startIndex, int maxResults)
- Specified by:
findGroupNamesByPrefix
in interfacecom.atlassian.sal.api.user.UserManager
-
isAdmin
public boolean isAdmin(String username)
- Specified by:
isAdmin
in interfacecom.atlassian.sal.api.user.UserManager
-
isAdmin
public boolean isAdmin(@Nullable com.atlassian.sal.api.user.UserKey userKey)
- Specified by:
isAdmin
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
getUserProfile
public com.atlassian.sal.api.user.UserProfile getUserProfile(String username)
- Specified by:
getUserProfile
in interfacecom.atlassian.sal.api.user.UserManager
-
getUserProfile
public @Nullable com.atlassian.sal.api.user.UserProfile getUserProfile(@Nullable com.atlassian.sal.api.user.UserKey userKey)
- Specified by:
getUserProfile
in interfacecom.atlassian.sal.api.user.UserManager
- Since:
- 5.2
-
-