Class UserAccountConfirmationSettings

java.lang.Object
org.exoplatform.portal.rest.UserAccountConfirmationSettings
All Implemented Interfaces:
org.picocontainer.Startable

public class UserAccountConfirmationSettings extends Object implements org.picocontainer.Startable
Settings of the one-time-password confirmation of administrator actions on user accounts: the switch that turns the confirmation off, changeable at runtime through JMX only, and the technical accounts exempted from it, read once from the server configuration and written by nothing else. The component is deliberately not exposed on the REST management endpoint: an administrator session could otherwise turn the confirmation off. It is started with the container, so that its JMX attribute exists from boot, before any guarded request.
  • Field Details

  • Constructor Details

    • UserAccountConfirmationSettings

      public UserAccountConfirmationSettings(org.exoplatform.container.xml.InitParams params, org.exoplatform.services.organization.OrganizationService organizationService, UserACL userACL)
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • isConfiguredEnabled

      public boolean isConfiguredEnabled()
      Returns:
      the configured value, which a restart restores
    • hasExemptedUsers

      public boolean hasExemptedUsers()
      Returns:
      whether a technical account is listed at all, so that a request with no exempted account configured never looks the user up
    • isExempted

      public boolean isExempted(String remoteUser)
      Whether the request's user is one of the technical accounts listed in the server configuration. The user name is resolved to the account's stored name, read again by that name with the enabled status (the key every eviction of the user cache uses, so a deactivated account is refused on its next request), and matched with the store's case rule. The super user is never exempted, whatever the list holds. A lookup that fails exempts nobody.
      Parameters:
      remoteUser - user name as the client signed in
      Returns:
      true when the account is exempted from the confirmation