Class AdminUserResource

java.lang.Object
com.atlassian.confluence.plugins.restapi.resources.AdminUserResource

public final class AdminUserResource extends Object
REST API for User management actions that require elevated privileges.
Since:
8.2.0
  • Constructor Details

    • AdminUserResource

      public AdminUserResource(PersonService personService)
  • Method Details

    • createUser

      public javax.ws.rs.core.Response createUser(UserDetailsForCreation userDetailsForCreation) throws URISyntaxException, UnsupportedEncodingException
      Creates a new active user.

      One of the following options could be used

      1. Create a user with a specified password. The userName, fullName, email and password needs to be specified
      2. Create a user with an email notification to the user. The userName, fullName, email and notifyViaEmail (true) needs to be specified
      The response would be a JSON returning the User Key for the newly created user

      Requirements

      • The userName should not be null or blank
      • The userName should not contain any of these characters \ , + invalid input: '<' > ' "
      • The userName should not contain any whitespace characters
      • The userName should not be "anonymous"
      • The userName should not contain any upper case characters
      • The fullName should not be null or blank
      • The fullName should not contain any of these characters invalid input: '<' >
      • The fullName should not be "anonymous"
      • The email should not be null or blank
      • The email should be a valid email address
      • If notifyViaEmail is false then the password should not be null or blank
      • If notifyViaEmail is true then the password should not be specified

      Parameters:
      userDetailsForCreation - Details of the user to be created
      Returns:
      Response A Response with generated UserKey for the created user.
      Throws:
      URISyntaxException
      UnsupportedEncodingException
    • disable

      public javax.ws.rs.core.Response disable(String username)
      Disable the given User identified by username. This method is idempotent i.e. if the user is already disabled then no action will be taken.
      Parameters:
      username - The username identifying the given user.
    • enable

      public javax.ws.rs.core.Response enable(String username)
      Enable the given User identified by username. This method is idempotent i.e. if the user is already enabled then no action will be taken.
      Parameters:
      username - The username identifying the given user.
    • delete

      public javax.ws.rs.core.Response delete(String username)
      Delete the given User identified by username. This action is processed asynchronously.
      Parameters:
      username - The username identifying the given user.
    • changePassword

      public javax.ws.rs.core.Response changePassword(String username, Credentials credentials)
      Change the password for the user identified by the username

      Validation rules : The new password should not be null or blank

      Parameters:
      username - The username identifying the given user.
      credentials - New password for the user.
      Returns:
      Response
      Since:
      8.4.0