Interface UserManager
- All Superinterfaces:
org.springframework.security.provisioning.GroupManager, GroupManager, org.springframework.security.provisioning.UserDetailsManager, UserDetailsManager, org.springframework.security.core.userdetails.UserDetailsService
- All Known Implementing Classes:
UserManagerImpl
Overrides gsec's UserManager to provide Gemma-specific types.
- Author:
- poirigui
-
Method Summary
Modifier and TypeMethodDescriptionvoidadminChangePassword(String username, String newPassword) Administrative password reset: set a new password for the named user without requiring their current password.voidchangePassword(String oldPassword, String newPassword) changePasswordForUser(String email, String username, String newPassword) createUser(String username, String email, String password) voidcreateUser(org.springframework.security.core.userdetails.UserDetails user) voiddeleteUser(String username) findGroupsForUser(String username) Find all the group a user is in.Obtain theUsercorresponding to the currently logged in user.Obtain the username of the currently logged in user.loadAll()voidsoftDeleteUser(String username, String deletedByUsername) Mark the named user as deleted without removing the row.voidupdateUser(org.springframework.security.core.userdetails.UserDetails user) voidupdateUserGroups(org.springframework.security.core.userdetails.UserDetails user, Collection<String> groups) Update the groups a user belong to.booleanuserExists(String username) booleanuserWithEmailExists(String emailAddress) booleanvalidateSignupToken(String username, String key) Validate the token previously generated byUserDetailsManager.generateSignupToken(String).Methods inherited from interface org.springframework.security.provisioning.GroupManager
addGroupAuthority, addUserToGroup, createGroup, deleteGroup, findAllGroups, findGroupAuthorities, findUsersInGroup, removeGroupAuthority, removeUserFromGroup, renameGroupMethods inherited from interface GroupManager
groupExists, setGroupDescriptionMethods inherited from interface UserDetailsManager
findAllUsers, generateSignupToken, loggedIn, reauthenticateMethods inherited from interface org.springframework.security.core.userdetails.UserDetailsService
loadUserByUsername
-
Method Details
-
findByEmail
-
findByUserName
-
findGroupsForUser
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_USER"}) Collection<String> findGroupsForUser(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException Description copied from interface:GroupManagerFind all the group a user is in.- Specified by:
findGroupsForUserin interfaceGroupManager- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
userWithEmailExists
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"}) boolean userWithEmailExists(String emailAddress) - Specified by:
userWithEmailExistsin interfaceUserDetailsManager- Parameters:
emailAddress-- Returns:
-
getCurrentUser
-
getCurrentUsername
String getCurrentUsername()Obtain the username of the currently logged in user.If no user is logged in, the principal of the anonymous authentication token is returned.
- Specified by:
getCurrentUsernamein interfaceUserDetailsManager
-
loadAll
-
userExists
- Specified by:
userExistsin interfaceorg.springframework.security.provisioning.UserDetailsManager
-
createUser
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"}) UserDetailsImpl createUser(String username, String email, String password) -
createUser
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"}) void createUser(org.springframework.security.core.userdetails.UserDetails user) - Specified by:
createUserin interfaceorg.springframework.security.provisioning.UserDetailsManager
-
updateUser
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"}) void updateUser(org.springframework.security.core.userdetails.UserDetails user) - Specified by:
updateUserin interfaceorg.springframework.security.provisioning.UserDetailsManager
-
updateUserGroups
@Secured("GROUP_ADMIN") void updateUserGroups(org.springframework.security.core.userdetails.UserDetails user, Collection<String> groups) Update the groups a user belong to. -
deleteUser
- Specified by:
deleteUserin interfaceorg.springframework.security.provisioning.UserDetailsManager
-
softDeleteUser
Mark the named user as deleted without removing the row. SetsdeletedAt= now,deletedBy= the supplied admin username, andenabled= false. ACL sids, audit-event authorship FKs, and other references to the row are preserved. Hard delete remains available viadeleteUser(String)for the rare cases where the row truly has no dependents. -
changePasswordForUser
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"}) String changePasswordForUser(String email, String username, String newPassword) - Specified by:
changePasswordForUserin interfaceUserDetailsManager- Parameters:
email-username-newPassword- - encoded- Returns:
- the confirmation token they will need to use.
-
changePassword
-
adminChangePassword
Administrative password reset: set a new password for the named user without requiring their current password. Distinct fromchangePasswordForUser(String, String, String)(the email-confirmation reset flow, which disables the account and issues a signup token) — this leaves the account enabled and immediately usable. The new password is encoded before storage. -
validateSignupToken
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"}) boolean validateSignupToken(String username, String key) Description copied from interface:UserDetailsManagerValidate the token previously generated byUserDetailsManager.generateSignupToken(String).- Specified by:
validateSignupTokenin interfaceUserDetailsManager- Parameters:
username-key-- Returns:
- true if okay, false otherwise
-