Package org.sonatype.security.usermanagement

Examples of org.sonatype.security.usermanagement.UserStatus


  protected boolean setAnonymousUserEnabled(final String anonymousUsername, final boolean enabled)
      throws InvalidConfigurationException
  {
    try {
      final User anonymousUser = getSecuritySystem().getUser(anonymousUsername, SecurityXmlUserManager.SOURCE);
      final UserStatus oldStatus = anonymousUser.getStatus();
      if (enabled) {
        anonymousUser.setStatus(UserStatus.active);
      }
      else {
        anonymousUser.setStatus(UserStatus.disabled);
      }
      getSecuritySystem().updateUser(anonymousUser);
      return !oldStatus.equals(anonymousUser.getStatus());
    }
    catch (UserNotFoundException e) {
      // ignore, anon user maybe manually deleted from XML realm by Nexus admin, is okay (kinda expected)
      log.debug(
          "Anonymous user not found while trying to disable it (as part of disabling anonymous access)!", e);
View Full Code Here

TOP

Related Classes of org.sonatype.security.usermanagement.UserStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.