@Transactional public class CachingApplicationService extends AbstractDelegatingApplicationService
Constructor and Description |
---|
CachingApplicationService(ApplicationService applicationService,
UserAuthorisationCache userAuthorisationCache) |
Modifier and Type | Method and Description |
---|---|
boolean |
isUserAuthorised(Application application,
String username)
Returns true if the user is permitted to attempt authentication with the application.
|
void |
removeUser(Application application,
String user)
Removes the user from the first active directory they are found in.
|
User |
renameUser(Application application,
String oldUserName,
String newUsername)
Renames the user in the first active directory the users exists in.
|
addAllUsers, addGroup, addGroupToGroup, addUser, addUser, addUserToGroup, authenticateUser, expireAllPasswords, findGroupByName, findGroupWithAttributesByName, findRemoteUserByName, findUserByKey, findUserByName, findUserWithAttributesByKey, findUserWithAttributesByName, findWebhookById, getApplicationService, getCapabilitiesForNewUsers, getCurrentEventToken, getNewEvents, getUserAvatar, getUserAvatarLink, isGroupDirectGroupMember, isGroupNestedGroupMember, isUserDirectGroupMember, isUserNestedGroupMember, registerWebhook, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUserAttributes, removeUserFromGroup, searchDirectGroupRelationships, searchGroups, searchNestedGroupRelationships, searchUsers, storeGroupAttributes, storeUserAttributes, unregisterWebhook, updateGroup, updateUser, updateUserCredential
public CachingApplicationService(ApplicationService applicationService, UserAuthorisationCache userAuthorisationCache)
public boolean isUserAuthorised(Application application, String username)
ApplicationService
For a user to have access to an application:
isUserAuthorised
in interface ApplicationService
isUserAuthorised
in class AbstractDelegatingApplicationService
application
- application user is authenticating againstusername
- usernamepublic User renameUser(Application application, String oldUserName, String newUsername) throws UserNotFoundException, OperationFailedException, ApplicationPermissionException, InvalidUserException
ApplicationService
If the user does not exist in ANY of the application's active assigned
directories, then a UserNotFoundException
will be thrown.
If the rename operation is not allowed on the User's directory, an
ApplicationPermissionException
is thrown.
If the rename operation fails on a directory for any other reason, such as directory failure, update failure, etc., an Exception is thrown immediately.
Returns the renamed User.
renameUser
in interface ApplicationService
renameUser
in class AbstractDelegatingApplicationService
application
- application with assigned directories to operate on.oldUserName
- current username of the user to rename.newUsername
- new username of the renamed user.UserNotFoundException
- user does not exist in any of the associated active directories of the application.OperationFailedException
- underlying directory implementation failed to execute the operation.ApplicationPermissionException
- if the User's directory is not allowed to perform operations of type OperationType.UPDATE_USER
.InvalidUserException
- if the new username does not meet the username requirements for an associated directory.public void removeUser(Application application, String user) throws OperationFailedException, UserNotFoundException, ApplicationPermissionException
ApplicationService
If the user does not exist in ANY of the application's assigned directories, then a UserNotFoundException
will be thrown.
If the remove operation fails because of permission restrictions, an ApplicationPermissionException is thrown.
removeUser
in interface ApplicationService
removeUser
in class AbstractDelegatingApplicationService
application
- remove from application's assigned directories.user
- the name of the user to remove.OperationFailedException
- underlying directory implementation failed to execute the operation.UserNotFoundException
- if user with given name does not exist in ANY assigned directory.ApplicationPermissionException
- if the User's directory does not have permission to perform operations of type OperationType.DELETE_USER
.Copyright © 2016 Atlassian. All rights reserved.