com.atlassian.crowd.service
Interface UserService

All Known Implementing Classes:
UserServiceImpl

public interface UserService


Method Summary
 boolean authenticate(java.lang.String username, java.lang.String password)
          Given a usernamen & password, this method checks, whether or not the provided user can be authenticated
 java.lang.String getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
          Returns the username of the currently logged in user or null if no user can be found.
 java.lang.String getRemoteUsername()
          Deprecated. use getAuthenticatedUsername(javax.servlet.http.HttpServletRequest)
 boolean isSystemAdmin(java.lang.String username)
          Returns true or false depending on if a user has been granted the system admin permission within Crowd.
 boolean isUserInGroup(java.lang.String username, java.lang.String group)
          Returns whether the user is in the specify group
 java.security.Principal resolve(java.lang.String username)
          Returns the user that made this request or null if this application does not have such a user.
 

Method Detail

getRemoteUsername

@Deprecated
java.lang.String getRemoteUsername()
Deprecated. use getAuthenticatedUsername(javax.servlet.http.HttpServletRequest)

Returns the username of the currently logged in user or null if no user can be found.

Returns:
The user name of the logged in user or null

getAuthenticatedUsername

java.lang.String getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
Returns the username of the currently logged in user or null if no user can be found.

Parameters:
request - The request to retrieve the username from
Returns:
The user name of the logged in user or null

isUserInGroup

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

Parameters:
username - The username to check
group - The group to check
Returns:
True if the user is in the specified group

isSystemAdmin

boolean isSystemAdmin(java.lang.String username)
                      throws org.springframework.dao.DataAccessException
Returns true or false depending on if a user has been granted the system admin permission within Crowd. This will usually mean that the user is a member of the crowd-administrators group OR the user is a member of a group assigned to the crowd application.

Parameters:
username - The username of the user to check
Returns:
true or false depending on if a user has been granted the system admin permission.
Throws:
org.springframework.dao.DataAccessException - if there was an error retrieving the username

authenticate

boolean authenticate(java.lang.String username,
                     java.lang.String password)
Given a usernamen & password, this method checks, whether or not the provided user can be authenticated

Parameters:
username - Username of the user
password - Password of the user
Returns:
True if the user can be authenticated, false otherwise

resolve

java.security.Principal resolve(java.lang.String username)
                                throws org.springframework.dao.DataAccessException
Returns the user that made this request or null if this application does not have such a user.

Parameters:
username - Username of the user a consumer is making a request on behalf of
Returns:
Principal corresponding to the username, null if the user does not exist
Throws:
org.springframework.dao.DataAccessException - if there was an error retrieving the username


Copyright © 2010 Atlassian. All Rights Reserved.