mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (4.3/Cloud)
73687: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud) 73547: Merged DEV to V4.2-BUG-FIX (4.2.3) 69607: MNT-11072 : Auditing not logging when system is on read only mode Additional fixes are required for AuditMethodInterceptor and AuditComponentImpl to write audit on read-only server. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@74802 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -259,14 +259,9 @@ public class AuditComponentImpl implements AuditComponent
|
|||||||
@Override
|
@Override
|
||||||
public boolean areAuditValuesRequired(String path)
|
public boolean areAuditValuesRequired(String path)
|
||||||
{
|
{
|
||||||
if (loggerInbound.isDebugEnabled())
|
|
||||||
{
|
|
||||||
return !transactionService.isReadOnly();
|
|
||||||
}
|
|
||||||
PathMapper pathMapper = auditModelRegistry.getAuditPathMapper();
|
PathMapper pathMapper = auditModelRegistry.getAuditPathMapper();
|
||||||
Set<String> mappedPaths = pathMapper.getMappedPathsWithPartialMatch(path);
|
Set<String> mappedPaths = pathMapper.getMappedPathsWithPartialMatch(path);
|
||||||
// for performance, fall through if no mapped paths so isReadyOnly is never called
|
return mappedPaths.size() > 0;
|
||||||
return (mappedPaths.size() > 0 && !transactionService.isReadOnly());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -152,15 +152,9 @@ public class AuditMethodInterceptor implements MethodInterceptor
|
|||||||
|
|
||||||
public Object invoke(MethodInvocation mi) throws Throwable
|
public Object invoke(MethodInvocation mi) throws Throwable
|
||||||
{
|
{
|
||||||
// Bypass all auditing if the system is in read-only mode
|
|
||||||
if (!transactionService.getAllowWrite())
|
|
||||||
{
|
|
||||||
return mi.proceed();
|
|
||||||
}
|
|
||||||
// Shortcut if no audit values are required
|
// Shortcut if no audit values are required
|
||||||
if(!auditComponent.areAuditValuesRequired(AUDIT_PATH_API_ROOT))
|
if(!auditComponent.areAuditValuesRequired(AUDIT_PATH_API_ROOT))
|
||||||
{
|
{
|
||||||
// No auditing or server is read-only
|
|
||||||
return mi.proceed();
|
return mi.proceed();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user