Fix AR-191, AR-192: CIFS and other network protocols will now treat everything as read-only when the server is in read-only mode

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3124 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-06-16 11:01:51 +00:00
parent dab54834b8
commit affce5b315
5 changed files with 66 additions and 12 deletions

View File

@@ -16,11 +16,14 @@
*/
package org.alfresco.repo.security.permissions.impl;
import net.sf.acegisecurity.AccessDeniedException;
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.dao.InvalidDataAccessApiUsageException;
/**
* Interceptor to translate and possibly I18Nize exceptions thrown by service calls.
*/
public class ExceptionTranslatorMethodInterceptor implements MethodInterceptor
{
private static final String MSG_ACCESS_DENIED = "permissions.err_access_denied";
@@ -36,10 +39,14 @@ public class ExceptionTranslatorMethodInterceptor implements MethodInterceptor
{
return mi.proceed();
}
catch(AccessDeniedException ade)
catch (net.sf.acegisecurity.AccessDeniedException ade)
{
throw new org.alfresco.repo.security.permissions.AccessDeniedException(MSG_ACCESS_DENIED, ade);
throw new AccessDeniedException(MSG_ACCESS_DENIED, ade);
}
catch (InvalidDataAccessApiUsageException e)
{
// this usually occurs when the server is in read-only mode
throw new AccessDeniedException(MSG_ACCESS_DENIED, e);
}
}
}