mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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
|
||||
|
@@ -444,12 +444,14 @@ public class LoginBean implements Serializable
|
||||
private static final String MSG_ERROR_LOGIN_MAXUSERS = "error_login_maxusers";
|
||||
private static final String MSG_NONE = "none";
|
||||
|
||||
public static final String MSG_ERROR_LOGIN_NOPERMISSIONS = "login_err_permissions";
|
||||
public static final String MSG_USERNAME_LENGTH = "login_err_username_length";
|
||||
public static final String MSG_PASSWORD_LENGTH = "login_err_password_length";
|
||||
public static final String MSG_USER_ERR = "user_err_user_name";
|
||||
|
||||
public static final String LOGIN_REDIRECT_KEY = "_alfRedirect";
|
||||
public static final String LOGIN_EXTERNAL_AUTH= "_alfExternalAuth";
|
||||
public static final String LOGIN_REDIRECT_KEY = "_alfRedirect";
|
||||
public static final String LOGIN_EXTERNAL_AUTH = "_alfExternalAuth";
|
||||
public static final String LOGIN_NOPERMISSIONS = "_alfNoPermissions";
|
||||
|
||||
/** user name */
|
||||
private String username = null;
|
||||
@@ -474,6 +476,4 @@ public class LoginBean implements Serializable
|
||||
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user