UserService
, org.springframework.security.core.userdetails.UserDetailsService
public class UserServiceImpl extends Object implements UserService
UserService
Constructor | Description |
---|---|
UserServiceImpl(ConfigurationService configurationService,
ProjectService projectService,
UserDAO userDAO,
PermissionDAO permissionDAO,
UserPreferencesDAO userPreferencesDAO) |
|
UserServiceImpl(ConfigurationService configurationService,
ProjectService projectService,
UserDAO userDAO,
ProjectDAO projectDAO,
ReportDAO reportDAO,
PermissionDAO permissionDAO,
UserPreferencesDAO userPreferencesDAO) |
Deprecated.
use constructor without projectDA= und reportDAO instead
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
addUserPermissions(Integer userId,
List<Permission> newPermissions) |
Resets all of the permissions for a user in the database.
|
boolean |
allowPasswordUpdates(User user,
Object authentication,
int authType,
int reqSource) |
This method checks to see if the given user's password can be updated locally.
|
boolean |
allowPermissionUpdates(User user,
Object authentication,
int authType,
int reqSource) |
This method checks to see if the given user's permission information
can be updated locally.
|
boolean |
allowPreferenceUpdates(User user,
Object authentication,
int authType,
int reqSource) |
This method checks to see if the given user's preference information
can be updated locally.
|
boolean |
allowProfileCreation(User user,
Object authentication,
int authType,
int reqSource) |
This method checks to see if a new user profile can be created within ITracker
|
boolean |
allowProfileUpdates(User user,
Object authentication,
int authType,
int reqSource) |
This method checks to see if the given user's core user profile information
can be updated locally.
|
boolean |
allowRegistration(User user,
Object authentication,
int authType,
int reqSource) |
This method checks to see if the given user is allowed to self register.
|
User |
checkLogin(String login,
Object authentication,
int authType,
int reqSource) |
This method checks the login of a user, and returns the user if authentication was successful.
|
void |
clearOwnedProjects(User user) |
|
User |
createUser(User user) |
|
List<User> |
findUsersForProjectByPermissionTypeList(Integer projectID,
PermissionType[] permissionTypes) |
Finds all users assigned to a project having all of the given permissionTypes.
|
String |
generateUserPassword(User user) |
|
List<User> |
getActiveUsers() |
|
List<User> |
getAllUsers() |
|
int |
getNumberUsers() |
|
List<Permission> |
getPermissionsByUserId(Integer userId) |
Returns an array of Permission objects for the requested userId.
|
List<User> |
getPossibleOwners(Issue issue,
Integer projectId,
Integer userId) |
|
List<User> |
getSuperUsers() |
|
User |
getUser(Integer userId) |
|
User |
getUserByLogin(String login) |
|
String |
getUserPasswordByLogin(String login) |
|
List<Permission> |
getUserPermissionsLocal(User user) |
This method will call local EJBs to find all permissions for a user.
|
Map<Integer,Set<PermissionType>> |
getUsersMapOfProjectIdsAndSetOfPermissionTypes(User user,
int reqSource) |
Deprecated.
|
List<User> |
getUsersWithAnyProjectPermission(Integer projectId,
int[] permissions) |
This method will return a list of users with any of the supplied permission, either explicitly, or
by their role as a super user.
|
List<User> |
getUsersWithAnyProjectPermission(Integer projectId,
int[] permissionTypes,
boolean activeOnly) |
|
List<User> |
getUsersWithAnyProjectPermission(Integer projectId,
PermissionType[] permissionTypes) |
This method will return a list of users with any of the supplied permission, either explicitly, or
by their role as a super user.
|
List<User> |
getUsersWithAnyProjectPermission(Integer projectId,
PermissionType[] permissions,
boolean activeOnly) |
This method will return a list of users with any of the supplied permission, either explicitly, or
by their role as a super user.
|
List<User> |
getUsersWithPermissionLocal(Integer projectId,
int permissionType) |
|
List<User> |
getUsersWithPermissionLocal(Integer projectId,
PermissionType permissionType) |
This method will call local EJBs to find users with a specific permission.
|
List<User> |
getUsersWithProjectPermission(Integer projectId,
int permissionType) |
|
List<User> |
getUsersWithProjectPermission(Integer projectId,
int[] permissionTypes,
boolean requireAll,
boolean activeOnly) |
|
List<User> |
getUsersWithProjectPermission(Integer projectId,
int permissionType,
boolean activeOnly) |
This method will return a list of users with a specific permission, either explicitly, or
by their role as a super user.
|
List<User> |
getUsersWithProjectPermission(Integer projectId,
PermissionType permission) |
This method will return a list of users with a specific permission, either explicitly, or
by their role as a super user.
|
List<User> |
getUsersWithProjectPermission(Integer projectId,
PermissionType[] permissionTypes,
boolean requireAll,
boolean activeOnly) |
This method will return a list of users with the supplied permission, either explicitly, or
by their role as a super user.
|
List<User> |
getUsersWithProjectPermission(Integer projectId,
PermissionType permissionType,
boolean activeOnly) |
|
org.springframework.security.core.userdetails.UserDetails |
loadUserByUsername(String username) |
|
boolean |
removeUserPermissions(Integer userId,
List<Permission> newPermissions) |
Resets all of the permissions for a user in the database.
|
boolean |
setUserPermissions(Integer userId,
List<Permission> newPermissions) |
Resets all of the permissions for a user in the database.
|
boolean |
updateAuthenticator(Integer userId,
List<Permission> permissions) |
Adds an additional set of permissions to a user in the database.
|
User |
updateUser(User user) |
|
UserPreferences |
updateUserPreferences(UserPreferences userPrefs) |
public UserServiceImpl(ConfigurationService configurationService, ProjectService projectService, UserDAO userDAO, PermissionDAO permissionDAO, UserPreferencesDAO userPreferencesDAO)
public UserServiceImpl(ConfigurationService configurationService, ProjectService projectService, UserDAO userDAO, ProjectDAO projectDAO, ReportDAO reportDAO, PermissionDAO permissionDAO, UserPreferencesDAO userPreferencesDAO)
public User getUser(Integer userId)
getUser
in interface UserService
public User getUserByLogin(String login) throws NoSuchEntityException
getUserByLogin
in interface UserService
NoSuchEntityException
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException
loadUserByUsername
in interface org.springframework.security.core.userdetails.UserDetailsService
org.springframework.security.core.userdetails.UsernameNotFoundException
public String getUserPasswordByLogin(String login)
getUserPasswordByLogin
in interface UserService
public List<User> getAllUsers()
getAllUsers
in interface UserService
public int getNumberUsers()
getNumberUsers
in interface UserService
public List<User> getActiveUsers()
getActiveUsers
in interface UserService
public List<User> getSuperUsers()
getSuperUsers
in interface UserService
public User createUser(User user) throws UserException
createUser
in interface UserService
UserException
public User updateUser(User user) throws UserException
updateUser
in interface UserService
UserException
public String generateUserPassword(User user) throws PasswordException
generateUserPassword
in interface UserService
PasswordException
public UserPreferences updateUserPreferences(UserPreferences userPrefs) throws UserException
updateUserPreferences
in interface UserService
UserException
public void clearOwnedProjects(User user)
clearOwnedProjects
in interface UserService
public List<User> findUsersForProjectByPermissionTypeList(Integer projectID, PermissionType[] permissionTypes)
UserService
findUsersForProjectByPermissionTypeList
in interface UserService
projectID
- the project IDpermissionTypes
- array of permission typespublic List<User> getUsersWithPermissionLocal(Integer projectId, PermissionType permissionType)
UserService
getUsersWithPermissionLocal
in interface UserService
projectId
- id of the project on which the returned users have permissionspermissionType
- the type of permission to search forpublic List<User> getUsersWithPermissionLocal(Integer projectId, int permissionType)
getUsersWithPermissionLocal
in interface UserService
public List<Permission> getUserPermissionsLocal(User user)
UserService
getUserPermissionsLocal
in interface UserService
user
- the user to find the permissions forpublic List<Permission> getPermissionsByUserId(Integer userId)
UserService
getPermissionsByUserId
in interface UserService
userId
- the userId, not the login, to find the permissions ofpublic boolean updateAuthenticator(Integer userId, List<Permission> permissions)
UserService
updateAuthenticator
in interface UserService
userId
- the userId, not login, of the user to add the permissions topermissions
- an array of PermissionModels that represent the new permissions to add to the userpublic boolean addUserPermissions(Integer userId, List<Permission> newPermissions)
UserService
addUserPermissions
in interface UserService
userId
- the userId, not login, of the user to add the permissions tonewPermissions
- a HashMap containing keys and Permission values as described in the method description.UserUtilities
public boolean setUserPermissions(Integer userId, List<Permission> newPermissions)
UserService
setUserPermissions
in interface UserService
userId
- - id of update-usernewPermissions
- - set of new permissions for this userUserUtilities
public boolean removeUserPermissions(Integer userId, List<Permission> newPermissions)
UserService
removeUserPermissions
in interface UserService
userId
- the userId, not login, of the user to add the permissions tonewPermissions
- a HashMap containing keys and Permission values as described in the method description.UserUtilities
@Deprecated public Map<Integer,Set<PermissionType>> getUsersMapOfProjectIdsAndSetOfPermissionTypes(User user, int reqSource)
UserService
getUsersMapOfProjectIdsAndSetOfPermissionTypes
in interface UserService
user
- a User representing the user that the permissions should be obtained forreqSource
- the source of the requestUserUtilities.hasPermission(java.util.Map<java.lang.Integer, java.util.Set<org.itracker.model.PermissionType>>, int)
public List<User> getUsersWithProjectPermission(Integer projectId, PermissionType permission)
UserService
getUsersWithProjectPermission
in interface UserService
projectId
- the project to find the permission forpermission
- the permission to check forpublic List<User> getUsersWithProjectPermission(Integer projectId, int permissionType)
getUsersWithProjectPermission
in interface UserService
public List<User> getUsersWithProjectPermission(Integer projectId, int permissionType, boolean activeOnly)
UserService
getUsersWithProjectPermission
in interface UserService
projectId
- the project to find the permission forpermissionType
- the permission to check foractiveOnly
- only include users who are currently activepublic List<User> getUsersWithProjectPermission(Integer projectId, PermissionType permissionType, boolean activeOnly)
getUsersWithProjectPermission
in interface UserService
public List<User> getUsersWithAnyProjectPermission(Integer projectId, int[] permissions)
UserService
getUsersWithAnyProjectPermission
in interface UserService
projectId
- the project to find the permission forpermissions
- the permissions that are checked againstpublic List<User> getUsersWithAnyProjectPermission(Integer projectId, PermissionType[] permissions, boolean activeOnly)
UserService
getUsersWithAnyProjectPermission
in interface UserService
projectId
- the project to find the permission forpermissions
- the permissions that are checked againstactiveOnly
- only include users who are currently activepublic List<User> getUsersWithAnyProjectPermission(Integer projectId, PermissionType[] permissionTypes)
UserService
getUsersWithAnyProjectPermission
in interface UserService
projectId
- the project to find the permission forpermissionTypes
- the permissions that are checked againstpublic List<User> getUsersWithAnyProjectPermission(Integer projectId, int[] permissionTypes, boolean activeOnly)
getUsersWithAnyProjectPermission
in interface UserService
public List<User> getUsersWithProjectPermission(Integer projectId, int[] permissionTypes, boolean requireAll, boolean activeOnly)
getUsersWithProjectPermission
in interface UserService
public List<User> getUsersWithProjectPermission(Integer projectId, PermissionType[] permissionTypes, boolean requireAll, boolean activeOnly)
UserService
getUsersWithProjectPermission
in interface UserService
projectId
- the project to find the permission forpermissionTypes
- the permissions that are checked againstrequireAll
- true if all the permissions in the array are required, false if only one is requiredactiveOnly
- only include users who are currently activepublic List<User> getPossibleOwners(Issue issue, Integer projectId, Integer userId)
getPossibleOwners
in interface UserService
public User checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException
UserService
checkLogin
in interface UserService
login
- the login the user/client providedauthentication
- the user's authentication information, if knownauthType
- the type of authentication information being providedreqSource
- the source from which the request was made (eg web, api)AuthenticatorException
- an exception if the login is unsuccessful, or an error occurspublic boolean allowRegistration(User user, Object authentication, int authType, int reqSource) throws AuthenticatorException
UserService
allowRegistration
in interface UserService
user
- a User object that contains the data the user submittedauthentication
- the user's authentication information, if knownauthType
- the type of authentication information being providedreqSource
- the source from which the request was made (eg web, api)AuthenticatorException
- an exception if an error occurspublic boolean allowProfileCreation(User user, Object authentication, int authType, int reqSource) throws AuthenticatorException
UserService
allowProfileCreation
in interface UserService
user
- a User object that contains the data for the new user. If null,
then the request is being made for an unknown future user. For example,
the system may request this with an null user if it needs to know if the system
should even present the option to create a new userauthentication
- the user's authentication information, if knownauthType
- the type of authentication information being providedreqSource
- the source from which the request was made (eg web, api)AuthenticatorException
- an exception if an error occurspublic boolean allowProfileUpdates(User user, Object authentication, int authType, int reqSource) throws AuthenticatorException
UserService
allowProfileUpdates
in interface UserService
user
- a User object that contains the data the user submittedauthentication
- the user's authentication information, if knownauthType
- the type of authentication information being providedreqSource
- the source from which the request was made (eg web, api)AuthenticatorException
- an exception if an error occurspublic boolean allowPasswordUpdates(User user, Object authentication, int authType, int reqSource) throws AuthenticatorException
UserService
allowPasswordUpdates
in interface UserService
user
- a User object that contains the data the user submittedauthentication
- the user's authentication information, if knownauthType
- the type of authentication information being providedreqSource
- the source from which the request was made (eg web, api)AuthenticatorException
- an exception if an error occurspublic boolean allowPermissionUpdates(User user, Object authentication, int authType, int reqSource) throws AuthenticatorException
UserService
allowPermissionUpdates
in interface UserService
user
- a User object that contains the data the user submittedauthentication
- the user's authentication information, if knownauthType
- the type of authentication information being providedreqSource
- the source from which the request was made (eg web, api)AuthenticatorException
- an exception if an error occurspublic boolean allowPreferenceUpdates(User user, Object authentication, int authType, int reqSource) throws AuthenticatorException
UserService
allowPreferenceUpdates
in interface UserService
user
- a User object that contains the data the user submittedauthentication
- the user's authentication information, if knownauthType
- the type of authentication information being providedreqSource
- the source from which the request was made (eg web, api)AuthenticatorException
- an exception if an error occursCopyright © 2002–2019 itracker. All rights reserved.