com.atlassian.sal.confluence.user
Class ConfluenceUserManager

java.lang.Object
  extended by com.atlassian.sal.confluence.user.ConfluenceUserManager
All Implemented Interfaces:
com.atlassian.sal.api.user.UserManager

public class ConfluenceUserManager
extends java.lang.Object
implements com.atlassian.sal.api.user.UserManager

Authenticates a user against UserAccessor in Confluence.


Constructor Summary
ConfluenceUserManager(UserAccessor userAccessor, com.atlassian.crowd.embedded.api.CrowdService crowdService, PermissionManager permissionManager)
           
 
Method Summary
 boolean authenticate(java.lang.String username, java.lang.String password)
           
 java.lang.Iterable<java.lang.String> findGroupNamesByPrefix(java.lang.String prefix, int startIndex, int maxResults)
           
 com.atlassian.sal.api.user.UserProfile getRemoteUser()
          
 com.atlassian.sal.api.user.UserProfile getRemoteUser(javax.servlet.http.HttpServletRequest httpServletRequest)
          
 com.atlassian.sal.api.user.UserKey getRemoteUserKey()
          
 com.atlassian.sal.api.user.UserKey getRemoteUserKey(javax.servlet.http.HttpServletRequest httpServletRequest)
          
 java.lang.String getRemoteUsername()
           
 java.lang.String getRemoteUsername(javax.servlet.http.HttpServletRequest request)
           
 com.atlassian.sal.api.user.UserProfile getUserProfile(java.lang.String username)
          
 com.atlassian.sal.api.user.UserProfile getUserProfile(com.atlassian.sal.api.user.UserKey userKey)
          
 boolean isAdmin(java.lang.String username)
           
 boolean isAdmin(com.atlassian.sal.api.user.UserKey userKey)
          
 boolean isSystemAdmin(java.lang.String username)
           
 boolean isSystemAdmin(com.atlassian.sal.api.user.UserKey userKey)
          
 boolean isUserInGroup(java.lang.String username, java.lang.String group)
          Returns whether the user is in the specify group
 boolean isUserInGroup(com.atlassian.sal.api.user.UserKey userKey, java.lang.String groupName)
          
 ConfluenceUser resolve(java.lang.String username)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceUserManager

public ConfluenceUserManager(UserAccessor userAccessor,
                             com.atlassian.crowd.embedded.api.CrowdService crowdService,
                             PermissionManager permissionManager)
Method Detail

getRemoteUsername

public java.lang.String getRemoteUsername()
Specified by:
getRemoteUsername in interface com.atlassian.sal.api.user.UserManager

getRemoteUser

@Nullable
public com.atlassian.sal.api.user.UserProfile getRemoteUser()

Specified by:
getRemoteUser in interface com.atlassian.sal.api.user.UserManager
Since:
5.2

getRemoteUserKey

@Nullable
public com.atlassian.sal.api.user.UserKey getRemoteUserKey()

Specified by:
getRemoteUserKey in interface com.atlassian.sal.api.user.UserManager
Since:
5.2

isSystemAdmin

public boolean isSystemAdmin(java.lang.String username)
Specified by:
isSystemAdmin in interface com.atlassian.sal.api.user.UserManager

isSystemAdmin

public boolean isSystemAdmin(@Nullable
                             com.atlassian.sal.api.user.UserKey userKey)

Specified by:
isSystemAdmin in interface com.atlassian.sal.api.user.UserManager
Since:
5.2

authenticate

public boolean authenticate(java.lang.String username,
                            java.lang.String password)
Specified by:
authenticate in interface com.atlassian.sal.api.user.UserManager

isUserInGroup

public boolean isUserInGroup(java.lang.String username,
                             java.lang.String group)
Returns whether the user is in the specify group

Specified by:
isUserInGroup in interface com.atlassian.sal.api.user.UserManager
Parameters:
username - The username to check
group - 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
                             java.lang.String groupName)

Specified by:
isUserInGroup in interface com.atlassian.sal.api.user.UserManager
Since:
5.2

getRemoteUsername

public java.lang.String getRemoteUsername(javax.servlet.http.HttpServletRequest request)
Specified by:
getRemoteUsername in interface com.atlassian.sal.api.user.UserManager

getRemoteUser

@Nullable
public com.atlassian.sal.api.user.UserProfile getRemoteUser(javax.servlet.http.HttpServletRequest httpServletRequest)

Specified by:
getRemoteUser in interface com.atlassian.sal.api.user.UserManager
Since:
5.2

getRemoteUserKey

@Nullable
public com.atlassian.sal.api.user.UserKey getRemoteUserKey(javax.servlet.http.HttpServletRequest httpServletRequest)

Specified by:
getRemoteUserKey in interface com.atlassian.sal.api.user.UserManager
Since:
5.2

resolve

public ConfluenceUser resolve(java.lang.String username)
Specified by:
resolve in interface com.atlassian.sal.api.user.UserManager

findGroupNamesByPrefix

public java.lang.Iterable<java.lang.String> findGroupNamesByPrefix(java.lang.String prefix,
                                                                   int startIndex,
                                                                   int maxResults)
Specified by:
findGroupNamesByPrefix in interface com.atlassian.sal.api.user.UserManager

isAdmin

public boolean isAdmin(java.lang.String username)
Specified by:
isAdmin in interface com.atlassian.sal.api.user.UserManager

isAdmin

public boolean isAdmin(@Nullable
                       com.atlassian.sal.api.user.UserKey userKey)

Specified by:
isAdmin in interface com.atlassian.sal.api.user.UserManager
Since:
5.2

getUserProfile

public com.atlassian.sal.api.user.UserProfile getUserProfile(java.lang.String username)

Specified by:
getUserProfile in interface com.atlassian.sal.api.user.UserManager

getUserProfile

@Nullable
public com.atlassian.sal.api.user.UserProfile getUserProfile(@Nullable
                                                                      com.atlassian.sal.api.user.UserKey userKey)

Specified by:
getUserProfile in interface com.atlassian.sal.api.user.UserManager
Since:
5.2


Copyright © 2003-2014 Atlassian. All Rights Reserved.