Interface UserManager

  • All Superinterfaces:
    gemma.gsec.authentication.GroupManager, org.springframework.security.provisioning.GroupManager, gemma.gsec.authentication.UserDetailsManager, org.springframework.security.provisioning.UserDetailsManager, org.springframework.security.core.userdetails.UserDetailsService
    All Known Implementing Classes:
    UserManagerImpl

    public interface UserManager
    extends gemma.gsec.authentication.UserDetailsManager, gemma.gsec.authentication.GroupManager
    Overrides gsec's UserManager to provide Gemma-specific types.
    Author:
    poirigui
    • Method Detail

      • findByEmail

        @Secured({"GROUP_USER","RUN_AS_ADMIN"})
        User findByEmail​(String s)
                  throws org.springframework.security.core.userdetails.UsernameNotFoundException
        Throws:
        org.springframework.security.core.userdetails.UsernameNotFoundException
      • findByUserName

        User findByUserName​(String s)
                     throws org.springframework.security.core.userdetails.UsernameNotFoundException
        Throws:
        org.springframework.security.core.userdetails.UsernameNotFoundException
      • findGroupsForUser

        @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_USER"})
        Collection<String> findGroupsForUser​(String username)
                                      throws org.springframework.security.core.userdetails.UsernameNotFoundException
        Specified by:
        findGroupsForUser in interface gemma.gsec.authentication.GroupManager
        Throws:
        org.springframework.security.core.userdetails.UsernameNotFoundException
      • userWithEmailExists

        @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"})
        boolean userWithEmailExists​(String emailAddress)
        Specified by:
        userWithEmailExists in interface gemma.gsec.authentication.UserDetailsManager
      • getCurrentUser

        @Nullable
        User getCurrentUser()
        Obtain the User corresponding to the currently logged in user.
        Returns:
        the user, or null if no user is logged in
      • 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:
        getCurrentUsername in interface gemma.gsec.authentication.UserDetailsManager
      • userExists

        @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"})
        boolean userExists​(String username)
        Specified by:
        userExists in interface org.springframework.security.provisioning.UserDetailsManager
      • createUser

        @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"})
        void createUser​(org.springframework.security.core.userdetails.UserDetails user)
        Specified by:
        createUser in interface org.springframework.security.provisioning.UserDetailsManager
      • updateUser

        @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"})
        void updateUser​(org.springframework.security.core.userdetails.UserDetails user)
        Specified by:
        updateUser in interface org.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

        @Secured("GROUP_ADMIN")
        void deleteUser​(String username)
        Specified by:
        deleteUser in interface org.springframework.security.provisioning.UserDetailsManager
      • changePasswordForUser

        @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"})
        String changePasswordForUser​(String email,
                                     String username,
                                     String newPassword)
        Specified by:
        changePasswordForUser in interface gemma.gsec.authentication.UserDetailsManager
      • changePassword

        @Secured("GROUP_USER")
        void changePassword​(String oldPassword,
                            String newPassword)
        Specified by:
        changePassword in interface org.springframework.security.provisioning.UserDetailsManager
      • validateSignupToken

        @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","RUN_AS_ADMIN"})
        boolean validateSignupToken​(String username,
                                    String key)
        Specified by:
        validateSignupToken in interface gemma.gsec.authentication.UserDetailsManager