mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
15828: ETHREEOH-2601: Users dialog won't delete users who have no authentication information - Moved the AuthenticationService.deleteAuthentication() call inside PersonService.deletePerson() and protected with try - catch so that if there is no authentication information (for an upgraded/moved user) the person can still be deleted - Removed a bunch of redundant deleteAuthentication() calls git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15829 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -41,6 +41,7 @@ import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.permissions.PermissionServiceSPI;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
@@ -58,6 +59,7 @@ import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.NoSuchPersonException;
|
||||
@@ -99,6 +101,8 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
private SearchService searchService;
|
||||
|
||||
private AuthorityService authorityService;
|
||||
|
||||
private AuthenticationService authenticationService;
|
||||
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
@@ -168,6 +172,7 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
PropertyCheck.mandatory(this, "searchService", searchService);
|
||||
PropertyCheck.mandatory(this, "permissionServiceSPI", permissionServiceSPI);
|
||||
PropertyCheck.mandatory(this, "authorityService", authorityService);
|
||||
PropertyCheck.mandatory(this, "authenticationService", authenticationService);
|
||||
PropertyCheck.mandatory(this, "namespacePrefixResolver", namespacePrefixResolver);
|
||||
PropertyCheck.mandatory(this, "policyComponent", policyComponent);
|
||||
PropertyCheck.mandatory(this, "personCache", personCache);
|
||||
@@ -648,6 +653,16 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove internally-stored password information, if any
|
||||
try
|
||||
{
|
||||
authenticationService.deleteAuthentication(userName);
|
||||
}
|
||||
catch (AuthenticationException e)
|
||||
{
|
||||
// Ignore this - externally authenticated user
|
||||
}
|
||||
|
||||
// remove user from any containing authorities
|
||||
Set<String> containerAuthorities = authorityService.getContainingAuthorities(null, userName, true);
|
||||
for (String containerAuthority : containerAuthorities)
|
||||
@@ -760,6 +775,11 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
{
|
||||
this.authorityService = authorityService;
|
||||
}
|
||||
|
||||
public void setAuthenticationService(AuthenticationService authenticationService)
|
||||
{
|
||||
this.authenticationService = authenticationService;
|
||||
}
|
||||
|
||||
public void setDictionaryService(DictionaryService dictionaryService)
|
||||
{
|
||||
|
Reference in New Issue
Block a user