Merged 5.0.N (5.0.3) to HEAD (5.1/Cloud) (PARTIAL MERGE)

109176: MNT-3053 : User can see page with information about all events (they are entitled to see) on all sites, if they use an incorrect url.
      - UserCalendarEntriesGet.java now returns 404 status code of requested site doesn't exist.
      - Unit test added.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@109197 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tatyana Valkevych
2015-07-30 09:49:52 +00:00
parent 930dff0dc3
commit ac0c8cc13f
2 changed files with 24 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.query.PagingRequest;
import org.alfresco.query.PagingResults;
import org.alfresco.repo.calendar.CalendarServiceImpl;
@@ -63,6 +65,13 @@ public class UserCalendarEntriesGet extends AbstractCalendarListingWebScript
if (siteName != null)
{
site = siteService.getSite(siteName);
// MNT-3053 fix, siteName was provided in request but it doesn't exists or user has no permissions to access it.
if (site == null)
{
status.setCode(HttpServletResponse.SC_NOT_FOUND, "Site '" + siteName + "' does not exist or user has no permissions to access it.");
return null;
}
}
return executeImpl(site, null, req, null, status, cache);