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:
@@ -419,6 +419,7 @@ login_err_password_length=Password must be between {0} and {1} characters in len
|
|||||||
login_err_password_chars=Password can only contain characters or digits.
|
login_err_password_chars=Password can only contain characters or digits.
|
||||||
login_err_username_length=Username must be between {0} and {1} characters in length.
|
login_err_username_length=Username must be between {0} and {1} characters in length.
|
||||||
login_err_username_chars=Username can only contain characters or digits.
|
login_err_username_chars=Username can only contain characters or digits.
|
||||||
|
login_err_permissions=The user does not have enough permissions to view the item, please attempt login as a different user.
|
||||||
loggedout_details=You have been logged out of Alfresco.
|
loggedout_details=You have been logged out of Alfresco.
|
||||||
relogin=Re-login to Alfresco
|
relogin=Re-login to Alfresco
|
||||||
no_access=You have no access to Alfresco.
|
no_access=You have no access to Alfresco.
|
||||||
|
@@ -40,6 +40,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.content.filestore.FileContentReader;
|
import org.alfresco.repo.content.filestore.FileContentReader;
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
import org.alfresco.service.cmr.model.FileInfo;
|
import org.alfresco.service.cmr.model.FileInfo;
|
||||||
import org.alfresco.service.cmr.model.FileNotFoundException;
|
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.URLDecoder;
|
||||||
import org.alfresco.util.URLEncoder;
|
import org.alfresco.util.URLEncoder;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
|
import org.alfresco.web.bean.LoginBean;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -229,6 +231,11 @@ public abstract class BaseDownloadContentServlet extends BaseServlet
|
|||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Redirecting to login page...");
|
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());
|
redirectToLoginPage(req, res, getServletContext());
|
||||||
}
|
}
|
||||||
else
|
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_ERROR_LOGIN_MAXUSERS = "error_login_maxusers";
|
||||||
private static final String MSG_NONE = "none";
|
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_USERNAME_LENGTH = "login_err_username_length";
|
||||||
public static final String MSG_PASSWORD_LENGTH = "login_err_password_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 MSG_USER_ERR = "user_err_user_name";
|
||||||
|
|
||||||
public static final String LOGIN_REDIRECT_KEY = "_alfRedirect";
|
public static final String LOGIN_REDIRECT_KEY = "_alfRedirect";
|
||||||
public static final String LOGIN_EXTERNAL_AUTH= "_alfExternalAuth";
|
public static final String LOGIN_EXTERNAL_AUTH = "_alfExternalAuth";
|
||||||
|
public static final String LOGIN_NOPERMISSIONS = "_alfNoPermissions";
|
||||||
|
|
||||||
/** user name */
|
/** user name */
|
||||||
private String username = null;
|
private String username = null;
|
||||||
@@ -474,6 +476,4 @@ public class LoginBean implements Serializable
|
|||||||
|
|
||||||
/** The user preferences bean reference */
|
/** The user preferences bean reference */
|
||||||
protected UserPreferencesBean preferences;
|
protected UserPreferencesBean preferences;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
@@ -31,7 +31,9 @@
|
|||||||
<%@ page import="org.alfresco.web.app.servlet.BaseServlet" %>
|
<%@ page import="org.alfresco.web.app.servlet.BaseServlet" %>
|
||||||
<%@ page import="org.alfresco.web.app.servlet.AuthenticationHelper" %>
|
<%@ page import="org.alfresco.web.app.servlet.AuthenticationHelper" %>
|
||||||
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
|
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
|
||||||
|
<%@ page import="org.alfresco.web.ui.common.Utils" %>
|
||||||
<%@ page import="org.alfresco.web.app.Application" %>
|
<%@ page import="org.alfresco.web.app.Application" %>
|
||||||
|
<%@ page import="org.alfresco.web.bean.LoginBean" %>
|
||||||
<%@ page import="javax.faces.context.FacesContext" %>
|
<%@ page import="javax.faces.context.FacesContext" %>
|
||||||
<%@ page import="javax.servlet.http.Cookie" %>
|
<%@ page import="javax.servlet.http.Cookie" %>
|
||||||
<%@ page import="java.util.Locale" %>
|
<%@ page import="java.util.Locale" %>
|
||||||
@@ -74,6 +76,13 @@
|
|||||||
|
|
||||||
// set locale for JSF framework usage
|
// set locale for JSF framework usage
|
||||||
fc.getViewRoot().setLocale(locale);
|
fc.getViewRoot().setLocale(locale);
|
||||||
|
|
||||||
|
// set permissions error if applicable
|
||||||
|
if (session.getAttribute(LoginBean.LOGIN_NOPERMISSIONS) != null)
|
||||||
|
{
|
||||||
|
Utils.addErrorMessage(Application.getMessage(fc, LoginBean.MSG_ERROR_LOGIN_NOPERMISSIONS));
|
||||||
|
session.setAttribute(LoginBean.LOGIN_NOPERMISSIONS, null);
|
||||||
|
}
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<%-- load a bundle of properties I18N strings here --%>
|
<%-- load a bundle of properties I18N strings here --%>
|
||||||
|
Reference in New Issue
Block a user