mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.1.N (5.1.1) to HEAD (5.2)
122427 rneamtu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1) (PARTIAL MERGE) 122412 nsmintanca: MNT-15642 CLONE - Request to join a moderated site multiple times -added validation on backend to prevent multiple requests for joining a site -updated unit tests -added widget to display "Cancel request" button git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123659 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2016 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -901,10 +901,23 @@ public class Site implements Serializable
|
||||
* @return the new invitation
|
||||
*/
|
||||
public ScriptInvitation<?> inviteModerated(String inviteeComments, String inviteeUserName, String inviteeRole)
|
||||
{
|
||||
InvitationSearchCriteriaImpl crit = new InvitationSearchCriteriaImpl();
|
||||
crit.setResourceName(getShortName());
|
||||
crit.setResourceType(Invitation.ResourceType.WEB_SITE);
|
||||
crit.setInvitee(inviteeUserName);
|
||||
|
||||
List<Invitation> invitations = invitationService.searchInvitation(crit);
|
||||
if(invitations.isEmpty())
|
||||
{
|
||||
Invitation invitation = invitationService.inviteModerated(inviteeComments, inviteeUserName, Invitation.ResourceType.WEB_SITE, getShortName(), inviteeRole);
|
||||
return scriptInvitationFactory.toScriptInvitation(invitation);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvitationException("A request to join this site is in pending");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new nominated invitation to this web site
|
||||
|
Reference in New Issue
Block a user