Interface User

All Superinterfaces:
Comparable<Principal>, Principal

public interface User extends Principal
FirstSpirit user.
Since:
2.3
  • Field Details

  • Method Details

    • getLoginName

      String getLoginName()
      Get the login name.
      Returns:
      The login name.
      Since:
      2.3
    • setLoginName

      void setLoginName(String name)
      Sets the login name.
      Parameters:
      name - The new login name.
      Since:
      2.3
    • setLoginPassword

      void setLoginPassword(String password)
      Sets the password of the user. Given password must be not null and not empty, otherwise a NullPointerException or IllegalArgumentException would be thrown.
      Parameters:
      password - the new password
      Throws:
      NullPointerException - if provided password is null.
      IllegalArgumentException - if the provided password is empty.
      Since:
      2.3
    • verifyPassword

      boolean verifyPassword(String password)
      Verify password.
      Parameters:
      password - the password to verify.
      Returns:
      true if the password is correct.
      Since:
      2.3
    • getRealname

      String getRealname()
      The realname of the user.
      Returns:
      the realname
      Since:
      2.3
    • setRealname

      void setRealname(String name)
      Sets the realname of the user.
      Parameters:
      name - the new realname
      Since:
      2.3
    • getEMail

      String getEMail()
      Gets eMail adress of the user.
      Returns:
      The eMail address.
      Since:
      2.3
    • setEMail

      void setEMail(String email)
      Sets the email address of the user.
      Parameters:
      email - the new email address.
      Since:
      2.3
    • getPhoneNumber

      String getPhoneNumber()
      Gets the phone number.
      Returns:
      the phone number.
      Since:
      2.3
    • setPhoneNumber

      void setPhoneNumber(String phone)
      Sets the phone number.
      Parameters:
      phone - the new phone number.
      Since:
      2.3
    • getAbbreviation

      String getAbbreviation()
      Gets the abbreviation of the user.
      Returns:
      The abbreviation.
      Since:
      2.3
    • setAbbreviation

      void setAbbreviation(String abbreviation)
      Sets the abbreviation of the user
      Parameters:
      abbreviation - the new abbreviation.
      Since:
      2.3
    • isLDAPUser

      boolean isLDAPUser()
      Returns true if this user is an LDAP user.
      Returns:
      true if this user is an LDAP user, else false.
      Since:
      2.3
    • setLDAPUser

      void setLDAPUser(boolean isLDAP)
      Sets the LDAPUser attribute of the User object
      Parameters:
      isLDAP - the new LDAPUser value
      Since:
      2.3
    • getLDAPSection

      String getLDAPSection()
      Gets the LDAPSection attribute of the User object
      Returns:
      the lDAPSection value
      Since:
      2.3
    • setLDAPSection

      void setLDAPSection(String section)
      Sets the lDAPSection attribute of the User object
      Parameters:
      section - the new LDAPSection value
      Since:
      2.3
    • isAdmin

      boolean isAdmin()
      Returns true if the user currently has admin permissions, i.e. is server adminand admin mode is enabled.
      Returns:
      boolean true if this user currently has admin permissions, false otherwise.
      Since:
      2.3
      See Also:
    • isServerAdmin

      boolean isServerAdmin()
      Returns true if this user is the super admin or a member of a server admin group. Only server admins areallowed to switch to admin mode.
      Returns:
      boolean true true if this user is a server admin, false otherwise
      Since:
      5.1.24
      See Also:
    • isProjectAdmin

      boolean isProjectAdmin(@Nullable @Nullable Project project)
      Tests if this user project admin for the provided project.
      By default a server admin isproject admin of all projects.
      Parameters:
      project - The project to verify against
      Returns:
      If the user is project admin for the provided project or false if the providedproject is null.
      Since:
      3.0.14
    • getAdminMode

      boolean getAdminMode() throws SecurityException
      Returns true if admin mode is enabled for this user. Admin mode is by default enabled if the user is aserver admin.
      Throws:
      SecurityException
      Since:
      5.1.24
      See Also:
    • setAdminMode

      void setAdminMode(boolean value) throws SecurityException
      Enable admin mode for this user with extended permissions. Admin mode is enabled by default if the user is a server admin, but may be explicity switched off in some environments.
      Parameters:
      value - Turn admin mode on or off.
      Throws:
      SecurityException - Thrown if this user is not a server admin
      Since:
      5.1.24
      See Also:
    • getUserBindings

      Map<String,String> getUserBindings()
      Get a map containing user bindings. Predefined keys are:
      • "url"
        default browser
      • "url_ctrl"
        browser used for preview when the ctrl key is pressed
      • "url_alt"
        browser used for preview when the alt key is pressed
      • "url_ctrl_alt"
        browser used for preview when the ctrl and alt key is pressed
      • "diffproggy"
        diff program
      Returns:
      the user bindings
      Since:
      4.0.17
      See Also:
    • setUserBindings

      void setUserBindings(Map<String,String> userBindings)
      Sets and saves the current user bindings.
      Parameters:
      userBindings - the new user bindings.
      Throws:
      SecurityException - if not called for current user or by admin user.
      Since:
      4.0.17
      See Also:
    • getFiletypeBindings

      Map<String,String> getFiletypeBindings()
      Get the file type bindings.
      Returns:
      a Map<String, String> mapping file extensions to program start commands
      Since:
      4.0.17
      See Also:
    • setFiletypeBindings

      void setFiletypeBindings(Map<String,String> fileTypeBindings) throws IOException
      Set the file type bindings
      Parameters:
      fileTypeBindings - mapping file extensions to program names
      Throws:
      IOException - if the save operation fails on the server
      SecurityException - if not called for current user or by admin user.
      Since:
      4.0.17
      See Also:
    • getName

      String getName()
      Get a combination of login- and realname.
      Specified by:
      getName in interface Principal
      Returns:
      combination of login- and realname (e.g. "pmaus (Paul Maus)").
      Since:
      4.0.17
    • isActive

      boolean isActive()
      Get state (active -> true or inactive -> false) of this user. If the user is deactivated no login is possible.
      Returns:
      true if the user is activated.
      Since:
      4.0.90
    • setActive

      void setActive(boolean active)
      Set activation state of user. If the user is deactivated no login is possible.
      Since:
      4.0.90
    • getExternalGroups

      @NotNull @NotNull Collection<ExternalGroup> getExternalGroups()
      Get the users external groups as a collection.
      Returns:
      the users external groups as a collection
      Since:
      5.2.190604