Class UserTools

java.lang.Object
io.goobi.viewer.model.security.user.UserTools

public final class UserTools extends Object
  • Method Details

    • deleteUser

      public static boolean deleteUser(User user) throws DAOException
      Deletes given user from the database and removes any database rows that reference this user (only those that are of use to this user - public content such as comments must be deleted separetely).
      Parameters:
      user - User to delete
      Returns:
      true if successful; false otherwise
      Throws:
      DAOException
    • deleteUserGroupOwnedByUser

      public static int deleteUserGroupOwnedByUser(User owner) throws DAOException
      Parameters:
      owner - Owner of groups to delete
      Returns:
      Number of deleted user groups
      Throws:
      DAOException
    • deleteBookmarkListsForUser

      public static int deleteBookmarkListsForUser(User owner) throws DAOException
      Parameters:
      owner -
      Returns:
      Number of deleted bookmark lists
      Throws:
      DAOException
    • deleteSearchesForUser

      public static int deleteSearchesForUser(User owner) throws DAOException
      Parameters:
      owner -
      Returns:
      Number of deleted searches
      Throws:
      DAOException
    • deleteUserPublicContributions

      public static void deleteUserPublicContributions(User user) throws DAOException
      Deletes all public content created by this the given user.
      Parameters:
      user -
      Throws:
      DAOException
    • anonymizeUserPublicContributions

      public static boolean anonymizeUserPublicContributions(User user) throws DAOException
      Moves all public content from the given user to an anonymous user.
      Parameters:
      user -
      Returns:
      true if successful; false otherwise
      Throws:
      DAOException
    • checkAndCreateAnonymousUser

      public static User checkAndCreateAnonymousUser() throws DAOException
      Returns:
      Created User
      Throws:
      DAOException
    • isNicknameInUse

      public static boolean isNicknameInUse(String nickname, Long userId) throws DAOException
      Parameters:
      nickname -
      userId -
      Returns:
      true if given nickname already in use by different user; false otherwise
      Throws:
      DAOException
    • isEmailInUse

      public static boolean isEmailInUse(String email, Long userId) throws DAOException
      Throws:
      DAOException