mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57912: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 57879: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 57877: MNT-9926: reformat code changes from 53236: MNT-9101 Share: Cancelling an invitation for a disabled user, the user gets deleted in the process. -add tests for both internal and external user invite cancellation -add new aspect to identify external invites and exclude from post invite cancellation cleanup git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61905 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -372,7 +372,6 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
|
|||||||
nodeService.removeAspect(person, ContentModel.ASPECT_ANULLABLE);
|
nodeService.removeAspect(person, ContentModel.ASPECT_ANULLABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return invitation;
|
return invitation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -185,15 +185,14 @@ public abstract class AbstractInvitationServiceImplTest extends BaseAlfrescoSpri
|
|||||||
assertNotNull("Invitation service is null", invitationService);
|
assertNotNull("Invitation service is null", invitationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MNT-9101 An internal user account (disabled) should not be deleted if
|
* MNT-9101 An internal user account (disabled) should not be deleted if an
|
||||||
* an associated nominated invitation is cancelled.
|
* associated nominated invitation is cancelled.
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void testInternalUserNotDeletedAfterInviteCancelled() throws Exception {
|
public void testInternalUserNotDeletedAfterInviteCancelled() throws Exception
|
||||||
|
{
|
||||||
// Disable our existing User
|
// Disable our existing User
|
||||||
boolean enabled = authenticationService.getAuthenticationEnabled(USER_ONE);
|
boolean enabled = authenticationService.getAuthenticationEnabled(USER_ONE);
|
||||||
assertTrue("User One authentication disabled", enabled);
|
assertTrue("User One authentication disabled", enabled);
|
||||||
@@ -211,9 +210,8 @@ public abstract class AbstractInvitationServiceImplTest extends BaseAlfrescoSpri
|
|||||||
this.authenticationComponent.setCurrentUser(USER_MANAGER);
|
this.authenticationComponent.setCurrentUser(USER_MANAGER);
|
||||||
|
|
||||||
// Invite our existing user
|
// Invite our existing user
|
||||||
NominatedInvitation nominatedInvitation = invitationService
|
NominatedInvitation nominatedInvitation = invitationService.inviteNominated(
|
||||||
.inviteNominated(inviteeUserName, resourceType, resourceName,
|
inviteeUserName, resourceType, resourceName, inviteeRole, acceptUrl, rejectUrl);
|
||||||
inviteeRole, acceptUrl, rejectUrl);
|
|
||||||
|
|
||||||
// Cancel the invite
|
// Cancel the invite
|
||||||
invitationService.cancel(nominatedInvitation.getInviteId());
|
invitationService.cancel(nominatedInvitation.getInviteId());
|
||||||
@@ -221,16 +219,16 @@ public abstract class AbstractInvitationServiceImplTest extends BaseAlfrescoSpri
|
|||||||
// Our User and associated Authentication still exists
|
// Our User and associated Authentication still exists
|
||||||
assertNotNull("User Exists", personService.getPersonOrNull(USER_ONE));
|
assertNotNull("User Exists", personService.getPersonOrNull(USER_ONE));
|
||||||
assertTrue("Authentication Exists", authenticationService.authenticationExists(USER_ONE));
|
assertTrue("Authentication Exists", authenticationService.authenticationExists(USER_ONE));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure that an External user account is deleted when an invite is cancelled
|
* Ensure that an External user account is deleted when an invite is
|
||||||
|
* cancelled
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void testExternalUserDeletedAfterInviteCancelled() throws Exception {
|
public void testExternalUserDeletedAfterInviteCancelled() throws Exception
|
||||||
|
{
|
||||||
String inviteeFirstName = PERSON_FIRSTNAME;
|
String inviteeFirstName = PERSON_FIRSTNAME;
|
||||||
String inviteeLastName = PERSON_LASTNAME;
|
String inviteeLastName = PERSON_LASTNAME;
|
||||||
String inviteeEmail = "123@alfrescotesting.com";
|
String inviteeEmail = "123@alfrescotesting.com";
|
||||||
@@ -243,8 +241,9 @@ public abstract class AbstractInvitationServiceImplTest extends BaseAlfrescoSpri
|
|||||||
|
|
||||||
this.authenticationComponent.setCurrentUser(USER_MANAGER);
|
this.authenticationComponent.setCurrentUser(USER_MANAGER);
|
||||||
|
|
||||||
NominatedInvitation nominatedInvitation = invitationService.inviteNominated(inviteeFirstName, inviteeLastName,
|
NominatedInvitation nominatedInvitation = invitationService.inviteNominated(
|
||||||
inviteeEmail, resourceType, resourceName, inviteeRole, serverPath, acceptUrl, rejectUrl);
|
inviteeFirstName, inviteeLastName, inviteeEmail, resourceType, resourceName,
|
||||||
|
inviteeRole, serverPath, acceptUrl, rejectUrl);
|
||||||
|
|
||||||
String inviteeUsername = nominatedInvitation.getInviteeUserName();
|
String inviteeUsername = nominatedInvitation.getInviteeUserName();
|
||||||
|
|
||||||
@@ -252,10 +251,10 @@ public abstract class AbstractInvitationServiceImplTest extends BaseAlfrescoSpri
|
|||||||
|
|
||||||
// Our User and Authentication has been removed
|
// Our User and Authentication has been removed
|
||||||
assertNull("Person deleted", personService.getPersonOrNull(inviteeUsername));
|
assertNull("Person deleted", personService.getPersonOrNull(inviteeUsername));
|
||||||
assertFalse("Authentication deleted", authenticationService.authenticationExists(inviteeUsername));
|
assertFalse("Authentication deleted",
|
||||||
|
authenticationService.authenticationExists(inviteeUsername));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test nominated user - new user
|
* Test nominated user - new user
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user