mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.2.N-AUDIT-API (5.2.2) to 5.2.N (5.2.2)
137892 eknizat: REPO-1298 Enable/Disable Application Auditing git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@137961 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -140,4 +140,30 @@ public class AuditImpl implements Audit
|
||||
return CollectionWithPagingInfo.asPaged(paging, auditApps, hasMoreItems, totalItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuditApp update(String auditAppId, AuditApp auditApp, Parameters parameters)
|
||||
{
|
||||
checkEnabled();
|
||||
|
||||
AuditService.AuditApplication auditApplication = findAuditAppById(auditAppId);
|
||||
|
||||
// Check if id is valid
|
||||
if (auditApplication == null)
|
||||
{
|
||||
throw new EntityNotFoundException(auditAppId);
|
||||
}
|
||||
|
||||
// Enable/Disable audit application
|
||||
if (auditApp.getIsEnabled() && !auditApplication.isEnabled())
|
||||
{
|
||||
auditService.enableAudit(auditApplication.getName(), auditApplication.getKey());
|
||||
}
|
||||
else if (!auditApp.getIsEnabled() && auditApplication.isEnabled())
|
||||
{
|
||||
auditService.disableAudit(auditApplication.getName(), auditApplication.getKey());
|
||||
}
|
||||
|
||||
return new AuditApp(auditApplication.getKey().substring(1), auditApplication.getName(), auditApp.getIsEnabled());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user