public class UserAdminResource extends Object
Constructor and Description |
---|
UserAdminResource(BambooAuthenticationContext bambooAuthenticationContext,
BambooPermissionManager bambooPermissionManager,
BambooUserManager bambooUserManager,
com.atlassian.crowd.embedded.api.CrowdDirectoryService crowdDirectoryService,
com.atlassian.crowd.embedded.api.CrowdService crowdService,
GravatarService gravatarService,
PaginationService paginationService,
RestUserAccessTokenService restUserAccessTokenService,
com.atlassian.struts.TextProvider textProvider,
com.atlassian.sal.api.transaction.TransactionTemplate transactionTemplate,
UserRenameService userRenameService,
ExtendedAuthorManager extendedAuthorManager) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
assignGroups(String userName,
List<String> groupsToAssign)
Add a user to multiple groups.
|
javax.ws.rs.core.Response |
changeUserPassword(RestUserPasswordUpdate passwordChangeRequest)
Change password of specified user
The authenticated user must have restricted administrative permission or higher to use this resource.
|
javax.ws.rs.core.Response |
createUser(RestNewUser newUser)
Create a new user.
|
javax.ws.rs.core.Response |
createUserRepositoryAlias(String userName,
List<String> userAliases)
Link existing unlined alias or create the new one.
|
javax.ws.rs.core.Response |
deleteUser(String userName)
Deletes the specified user, removing them from the system.
|
RestPageModel<RestGroup> |
findAssignedGroups(String userName,
String filter,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo)
Retrieves a list of groups to which the user belongs.
|
RestPageModel<RestGroup> |
findUnassignedGroups(String userName,
String filter,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo)
Retrieves a list of groups to which the user does not belong.
|
RestPageModel<RestUserAlias> |
findUnassignedUserRepositoryAliases(String filter,
String userName,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo)
Retrieves a list of unlinked aliases to which the user does not belong.
|
RestPageModel<RestAccessToken> |
getUserAccessTokens(String userName,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo)
Retrieve a page of user's access tokens.
|
RestPageModel<RestUserAlias> |
getUserRepositoryAliases(String userName,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo)
Retrieve a page of aliases.
|
RestPageModel<RestUserDetails> |
getUsers(String filter,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo)
Retrieve a page of users.
|
javax.ws.rs.core.Response |
renameUser(RestUserRenameRequest userRenameRequest)
Renames specified user
The authenticated user must have restricted administrative permission or higher to use this resource.
|
javax.ws.rs.core.Response |
revokeUserToken(String userName,
String tokenId)
Revoke user's access token.
|
javax.ws.rs.core.Response |
unassignGroups(String userName,
List<String> groupsToRemove)
Remove a user from multiple groups.
|
javax.ws.rs.core.Response |
unlinkUserRepositoryAlias(String userName,
RestUserAlias alias)
Unlink the specified alias from user, removing them from the system.
|
@Inject public UserAdminResource(BambooAuthenticationContext bambooAuthenticationContext, BambooPermissionManager bambooPermissionManager, BambooUserManager bambooUserManager, com.atlassian.crowd.embedded.api.CrowdDirectoryService crowdDirectoryService, com.atlassian.crowd.embedded.api.CrowdService crowdService, GravatarService gravatarService, PaginationService paginationService, RestUserAccessTokenService restUserAccessTokenService, com.atlassian.struts.TextProvider textProvider, com.atlassian.sal.api.transaction.TransactionTemplate transactionTemplate, UserRenameService userRenameService, ExtendedAuthorManager extendedAuthorManager)
public RestPageModel<RestUserDetails> getUsers(String filter, @Context PageRequest pageRequest, @Context Expansion expansion, @Context javax.ws.rs.core.UriInfo uriInfo)
filter
- If specified only users, whose username, full name or email contain the supplied string (case insensitive) will be returned.public javax.ws.rs.core.Response createUser(@RequestBody RestNewUser newUser) throws WebValidationException
WebValidationException
public javax.ws.rs.core.Response deleteUser(String userName) throws WebValidationException
userName
- The name identifying the user to delete.WebValidationException
public javax.ws.rs.core.Response renameUser(@RequestBody RestUserRenameRequest userRenameRequest) throws UserRenameException, WebValidationException
public javax.ws.rs.core.Response changeUserPassword(@RequestBody RestUserPasswordUpdate passwordChangeRequest) throws WebValidationException, com.atlassian.user.EntityException
WebValidationException
com.atlassian.user.EntityException
public javax.ws.rs.core.Response assignGroups(String userName, @RequestBody List<String> groupsToAssign) throws WebValidationException
userName
- The name identifying the user.WebValidationException
public javax.ws.rs.core.Response unassignGroups(String userName, @RequestBody List<String> groupsToRemove) throws WebValidationException
userName
- The name identifying the user.WebValidationException
public RestPageModel<RestGroup> findAssignedGroups(String userName, String filter, @Context PageRequest pageRequest, @Context Expansion expansion, @Context javax.ws.rs.core.UriInfo uriInfo)
userName
- The name identifying the user.filter
- If specified, only groups with names containing the supplied string will be returned.public RestPageModel<RestGroup> findUnassignedGroups(String userName, String filter, @Context PageRequest pageRequest, @Context Expansion expansion, @Context javax.ws.rs.core.UriInfo uriInfo) throws com.atlassian.user.EntityException
userName
- The name identifying the user.filter
- If specified, only groups with names containing the supplied string will be returned.com.atlassian.user.EntityException
public RestPageModel<RestUserAlias> findUnassignedUserRepositoryAliases(String filter, String userName, @Context PageRequest pageRequest, @Context Expansion expansion, @Context javax.ws.rs.core.UriInfo uriInfo)
userName
- The name identifying the user.filter
- If specified, only aliases with names containing the supplied string will be returned.public RestPageModel<RestUserAlias> getUserRepositoryAliases(String userName, @Context PageRequest pageRequest, @Context Expansion expansion, @Context javax.ws.rs.core.UriInfo uriInfo)
public javax.ws.rs.core.Response createUserRepositoryAlias(String userName, @RequestBody List<String> userAliases)
public javax.ws.rs.core.Response unlinkUserRepositoryAlias(String userName, @RequestBody RestUserAlias alias)
userName
- The name identifying the user to delete.alias
- alias to unlinkpublic RestPageModel<RestAccessToken> getUserAccessTokens(String userName, @Context PageRequest pageRequest, @Context Expansion expansion, @Context javax.ws.rs.core.UriInfo uriInfo)
public javax.ws.rs.core.Response revokeUserToken(String userName, String tokenId) throws WebValidationException
userName
- The name identifying the user to revoke access token from.tokenId
- id of tokenWebValidationException
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.