Class AdminUserResource
- java.lang.Object
-
- com.atlassian.confluence.plugins.restapi.resources.AdminUserResource
-
-
Constructor Summary
Constructors Constructor Description AdminUserResource(PersonService personService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsechangePassword(String username, Credentials credentials)Change the password for the user identified by the usernamejavax.ws.rs.core.ResponsecreateUser(UserDetailsForCreation userDetailsForCreation)Creates a new active user.javax.ws.rs.core.Responsedelete(String username)Delete the givenUseridentified by username.javax.ws.rs.core.Responsedisable(String username)Disable the givenUseridentified by username.javax.ws.rs.core.Responseenable(String username)Enable the givenUseridentified by username.
-
-
-
Constructor Detail
-
AdminUserResource
public AdminUserResource(PersonService personService)
-
-
Method Detail
-
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
- Create a user with a specified password. The userName, fullName, email and password needs to be specified
- Create a user with an email notification to the user. The userName, fullName, email and notifyViaEmail (true) needs to be specified
Requirements
- The userName should not be null or blank
- The userName should not contain any of these characters \ , + < > ' "
- 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 < >
- 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:
URISyntaxExceptionUnsupportedEncodingException
-
disable
public javax.ws.rs.core.Response disable(String username)
Disable the givenUseridentified 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 givenUseridentified 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 givenUseridentified 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 usernameValidation 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
-
-