Fix for ALFCOM-1311 - message now shown on the Explorer login page when user does not have enough permissions to view an item.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14512 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2009-06-03 10:48:49 +00:00
parent 67971c3851
commit 94de11a162
4 changed files with 22 additions and 5 deletions

View File

@@ -40,6 +40,7 @@ import javax.servlet.http.HttpServletResponse;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.filestore.FileContentReader;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.model.FileNotFoundException;
@@ -56,6 +57,7 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.util.URLDecoder;
import org.alfresco.util.URLEncoder;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.LoginBean;
import org.apache.commons.logging.Log;
/**
@@ -229,6 +231,11 @@ public abstract class BaseDownloadContentServlet extends BaseServlet
if (logger.isDebugEnabled())
logger.debug("Redirecting to login page...");
// TODO: replace with serviceRegistry.getAuthorityService().hasGuestAuthority() from 3.1E
if (!AuthenticationUtil.getFullyAuthenticatedUser().equals(AuthenticationUtil.getGuestUserName()))
{
req.getSession().setAttribute(LoginBean.LOGIN_NOPERMISSIONS, Boolean.TRUE);
}
redirectToLoginPage(req, res, getServletContext());
}
else