From 764f636117aed1a4b9854c270809361691e3c74a Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 24 Apr 2018 08:45:56 +0100 Subject: [PATCH 01/29] RM-5236 Audit events for creating and deleting a user group. --- .../messages/audit-service.properties | 2 + .../rm-audit-context.xml | 12 +++ .../event/CreateUserGroupAuditEvent.java | 50 +++++++++++ .../event/DeleteUserGroupAuditEvent.java | 82 +++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties index 5f8a331f0a..b066c5d93d 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties @@ -5,6 +5,8 @@ rm.audit.login-succeeded=Login Successful rm.audit.login-failed=Login Unsuccessful rm.audit.create-person=Create User rm.audit.delete-person=Delete User +rm.audit.create-userGroup=Create User Group +rm.audit.delete-userGroup=Delete User Group rm.audit.linkTo=Link to rm.audit.moveTo=Move to rm.audit.copyTo=Copy to diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml index 1a1b993d1a..7b5f03018e 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml @@ -64,6 +64,18 @@ + + + + + + + + + + + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java new file mode 100644 index 0000000000..034e23061e --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java @@ -0,0 +1,50 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.module.org_alfresco_module_rm.audit.event; + +import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy; +import org.alfresco.repo.policy.annotation.Behaviour; +import org.alfresco.repo.policy.annotation.BehaviourBean; +import org.alfresco.repo.policy.annotation.BehaviourKind; +import org.alfresco.service.cmr.repository.ChildAssociationRef; + +/** + * Audits user group creation. + * + * @author Tom Page + * @since 2.7 + */ +@BehaviourBean +public class CreateUserGroupAuditEvent extends AuditEvent implements OnCreateNodePolicy +{ + @Override + @Behaviour(kind = BehaviourKind.CLASS, type = "cm:authorityContainer") + public void onCreateNode(ChildAssociationRef childAssocRef) + { + recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName()); + } +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java new file mode 100644 index 0000000000..810aca345d --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java @@ -0,0 +1,82 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ + +package org.alfresco.module.org_alfresco_module_rm.audit.event; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy; +import org.alfresco.repo.policy.annotation.Behaviour; +import org.alfresco.repo.policy.annotation.BehaviourBean; +import org.alfresco.repo.policy.annotation.BehaviourKind; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; + +/** + * Audits user group deletion. + * + * @author Tom Page + * @since 2.7 + */ +@BehaviourBean +public class DeleteUserGroupAuditEvent extends AuditEvent implements BeforeDeleteNodePolicy +{ + /** Node Service */ + private NodeService nodeService; + + /** + * Sets the node service + * + * @param nodeService nodeService to set + */ + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + + /** + * Behaviour that will audit user deletion + * + * @param nodeRef the node to be deleted + */ + @Override + @Behaviour(kind = BehaviourKind.CLASS, type = "cm:authorityContainer") + public void beforeDeleteNode(NodeRef nodeRef) + { + // Retrieve the authority name property to be audited + Map auditProperties = new HashMap<>(); + auditProperties.put(ContentModel.PROP_AUTHORITY_NAME, + nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHORITY_NAME)); + + //audit the property values before the delete event + recordsManagementAuditService.auditEvent(nodeRef, getName(), auditProperties, null, true, false); + } +} From f36c606267ef9608ceb2d6603510821bad29063d Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 24 Apr 2018 10:41:06 +0100 Subject: [PATCH 02/29] RM-5236 Audit user group events. Add audit events for user group creation and deletion. Also update the create user event so that the username is still displayed after the user is deleted. --- .../rm-audit-context.xml | 2 + .../RecordsManagementAuditServiceImpl.java | 85 +++++++++++++------ .../audit/event/CreatePersonAuditEvent.java | 32 +++++-- .../event/CreateUserGroupAuditEvent.java | 26 +++++- 4 files changed, 113 insertions(+), 32 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml index 7b5f03018e..2a62aa660c 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml @@ -53,6 +53,7 @@ + @@ -65,6 +66,7 @@ + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java index 4638409234..e45b86dee2 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java @@ -1503,31 +1503,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean json.put("fullName", entry.getFullName() == null ? "": entry.getFullName()); json.put("nodeRef", entry.getNodeRef() == null ? "": entry.getNodeRef()); - // TODO: Find another way for checking the event - if (entry.getEvent().equals("Create Person") && entry.getNodeRef() != null) - { - NodeRef nodeRef = entry.getNodeRef(); - String userName = null; - if(nodeService.exists(nodeRef)) - { - userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME); - } - json.put("nodeName", userName == null ? "": userName); - json.put("createPerson", true); - } - else if (entry.getEvent().equals("Delete Person") && entry.getNodeRef() != null) - { - if (entry.getBeforeProperties() != null) - { - String userName = (String) entry.getBeforeProperties().get(ContentModel.PROP_USERNAME); - json.put("nodeName", userName == null ? "" : userName); - } - json.put("deletePerson", true); - } - else - { - json.put("nodeName", entry.getNodeName() == null ? "": entry.getNodeName()); - } + setNodeName(entry, json); // TODO: Find another way for checking the event if (entry.getEvent().equals("Delete RM Object")) @@ -1586,6 +1562,65 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean } } + /** + * Update a JSON object with a node name for an audit event. + * + * @param entry The audit event. + * @param json The object to update. + * @throws JSONException If there is a problem updating the JSON. + */ + private void setNodeName(RecordsManagementAuditEntry entry, JSONObject json) throws JSONException + { + String nodeName = null; + if (entry.getNodeRef() != null) + { + // TODO: Find another way for checking the event + switch (entry.getEvent()) + { + case "Create Person": + if (entry.getAfterProperties() != null) + { + nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_USERNAME); + } + // This is needed as older audit events (pre-2.7) were created without PROP_USERNAME being set. + NodeRef nodeRef = entry.getNodeRef(); + if (nodeName == null && nodeService.exists(nodeRef)) + { + nodeName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME); + } + json.put("createPerson", true); + break; + + case "Delete Person": + if (entry.getBeforeProperties() != null) + { + nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_USERNAME); + } + json.put("deletePerson", true); + break; + + case "Create User Group": + if (entry.getAfterProperties() != null) + { + nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_AUTHORITY_NAME); + } + break; + + case "Delete User Group": + if (entry.getBeforeProperties() != null) + { + nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_AUTHORITY_NAME); + } + break; + + default: + nodeName = entry.getNodeName(); + break; + } + } + json.put("nodeName", nodeName == null ? "" : nodeName); + } + /** * Helper method to convert value to MLText * diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreatePersonAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreatePersonAuditEvent.java index d46103d0c9..e54683c1d0 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreatePersonAuditEvent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreatePersonAuditEvent.java @@ -27,11 +27,18 @@ package org.alfresco.module.org_alfresco_module_rm.audit.event; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.model.ContentModel; import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; import org.alfresco.repo.policy.annotation.BehaviourKind; import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; /** * Audits person creation. @@ -42,17 +49,30 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef; @BehaviourBean public class CreatePersonAuditEvent extends AuditEvent implements OnCreateNodePolicy { + /** Node Service */ + private NodeService nodeService; + + /** + * Sets the node service + * + * @param nodeService nodeService to set + */ + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + /** * @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef) */ @Override - @Behaviour - ( - kind = BehaviourKind.CLASS, - type = "cm:person" - ) + @Behaviour(kind = BehaviourKind.CLASS, type = "cm:person") public void onCreateNode(ChildAssociationRef childAssocRef) { - recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName()); + Map auditProperties = new HashMap<>(); + auditProperties.put(ContentModel.PROP_USERNAME, + nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_USERNAME)); + + recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName(), null, auditProperties); } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java index 034e23061e..a80e8aab54 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java @@ -26,11 +26,18 @@ */ package org.alfresco.module.org_alfresco_module_rm.audit.event; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.model.ContentModel; import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; import org.alfresco.repo.policy.annotation.BehaviourKind; import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; /** * Audits user group creation. @@ -41,10 +48,27 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef; @BehaviourBean public class CreateUserGroupAuditEvent extends AuditEvent implements OnCreateNodePolicy { + /** Node Service */ + private NodeService nodeService; + + /** + * Sets the node service + * + * @param nodeService nodeService to set + */ + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + @Override @Behaviour(kind = BehaviourKind.CLASS, type = "cm:authorityContainer") public void onCreateNode(ChildAssociationRef childAssocRef) { - recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName()); + Map auditProperties = new HashMap<>(); + auditProperties.put(ContentModel.PROP_AUTHORITY_NAME, + nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_AUTHORITY_NAME)); + + recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName(), null, auditProperties); } } From e53c6de2fcb98d8ac1c1c5ff56ee8b4d0d8ac87c Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 25 Apr 2018 10:54:01 +0100 Subject: [PATCH 03/29] RM-5236 Audit event for adding member to user group. --- .../messages/audit-service.properties | 1 + .../rm-audit-context.xml | 6 ++ .../audit/event/AddToUserGroupAuditEvent.java | 83 +++++++++++++++++++ .../event/CreateUserGroupAuditEvent.java | 1 + .../event/DeleteUserGroupAuditEvent.java | 2 +- 5 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties index b066c5d93d..9f376f0cf1 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties @@ -7,6 +7,7 @@ rm.audit.create-person=Create User rm.audit.delete-person=Delete User rm.audit.create-userGroup=Create User Group rm.audit.delete-userGroup=Delete User Group +rm.audit.addMember=Add To User Group rm.audit.linkTo=Link to rm.audit.moveTo=Move to rm.audit.copyTo=Copy to diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml index 2a62aa660c..45a804bfd1 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml @@ -78,6 +78,12 @@ + + + + + + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java new file mode 100644 index 0000000000..d8a0422329 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java @@ -0,0 +1,83 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ + +package org.alfresco.module.org_alfresco_module_rm.audit.event; + +import static org.alfresco.repo.policy.Behaviour.NotificationFrequency.EVERY_EVENT; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy; +import org.alfresco.repo.policy.annotation.Behaviour; +import org.alfresco.repo.policy.annotation.BehaviourBean; +import org.alfresco.repo.policy.annotation.BehaviourKind; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; + +/** + * Add an authority to a user group. + * + * @author Tom Page + * @since 2.7 + */ +@BehaviourBean(defaultType = "cm:authorityContainer") +public class AddToUserGroupAuditEvent extends AuditEvent implements OnCreateChildAssociationPolicy +{ + /** Node Service */ + private NodeService nodeService; + + /** + * Sets the node service + * + * @param nodeService nodeService to set + */ + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + + /** Behaviour to audit adding an authority to a user group. */ + @Override + @Behaviour(kind = BehaviourKind.ASSOCIATION, notificationFrequency = EVERY_EVENT, assocType = "cm:member") + public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode) + { + Map auditProperties = new HashMap<>(); + auditProperties.put(ContentModel.PROP_AUTHORITY_NAME, + nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_AUTHORITY_NAME)); + auditProperties.put(ContentModel.PROP_USERNAME, + nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_USERNAME)); + // (Ab)use link destination property here, as it vaguely sounds like where the authority ends up. + auditProperties.put(ContentModel.PROP_LINK_DESTINATION, + nodeService.getProperty(childAssocRef.getParentRef(), ContentModel.PROP_AUTHORITY_NAME)); + + recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName(), null, auditProperties); + } +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java index a80e8aab54..177bf0c75b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java @@ -61,6 +61,7 @@ public class CreateUserGroupAuditEvent extends AuditEvent implements OnCreateNod this.nodeService = nodeService; } + /** Behaviour to audit user group creation. */ @Override @Behaviour(kind = BehaviourKind.CLASS, type = "cm:authorityContainer") public void onCreateNode(ChildAssociationRef childAssocRef) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java index 810aca345d..ce4d2f6bf9 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java @@ -63,7 +63,7 @@ public class DeleteUserGroupAuditEvent extends AuditEvent implements BeforeDelet } /** - * Behaviour that will audit user deletion + * Behaviour that will audit user group deletion * * @param nodeRef the node to be deleted */ From e83824993f7515e1c94ce1e411a8bbcd21946cf0 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Wed, 25 Apr 2018 12:08:19 +0100 Subject: [PATCH 04/29] RM-5236 Audit event for removing group members. Also tidy up title of audit events so that the user group display label is used if it exists. --- .../messages/audit-service.properties | 1 + .../rm-audit-context.xml | 6 ++ .../RecordsManagementAuditServiceImpl.java | 28 +++++- .../audit/event/AddToUserGroupAuditEvent.java | 15 +-- .../event/CreateUserGroupAuditEvent.java | 4 +- .../event/DeleteUserGroupAuditEvent.java | 4 +- .../event/RemoveFromUserGroupAuditEvent.java | 74 +++++++++++++++ .../audit/event/UserGroupMembershipUtils.java | 92 +++++++++++++++++++ 8 files changed, 206 insertions(+), 18 deletions(-) create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/RemoveFromUserGroupAuditEvent.java create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/UserGroupMembershipUtils.java diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties index 9f376f0cf1..e5e7289396 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service.properties @@ -8,6 +8,7 @@ rm.audit.delete-person=Delete User rm.audit.create-userGroup=Create User Group rm.audit.delete-userGroup=Delete User Group rm.audit.addMember=Add To User Group +rm.audit.removeMember=Remove From User Group rm.audit.linkTo=Link to rm.audit.moveTo=Move to rm.audit.copyTo=Copy to diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml index 45a804bfd1..b7c7ce514e 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-audit-context.xml @@ -84,6 +84,12 @@ + + + + + + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java index e45b86dee2..255b59d09b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java @@ -27,8 +27,10 @@ package org.alfresco.module.org_alfresco_module_rm.audit; +import static org.alfresco.module.org_alfresco_module_rm.audit.event.UserGroupMembershipUtils.PARENT_GROUP; import static org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model.TYPE_DOD_5015_SITE; import static org.alfresco.module.org_alfresco_module_rm.model.rma.type.RmSiteType.DEFAULT_SITE_NAME; +import static org.apache.commons.lang3.StringUtils.isBlank; import java.io.BufferedWriter; import java.io.File; @@ -1602,14 +1604,36 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean case "Create User Group": if (entry.getAfterProperties() != null) { - nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_AUTHORITY_NAME); + nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_AUTHORITY_DISPLAY_NAME); + if (isBlank(nodeName)) + { + nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_AUTHORITY_NAME); + } } break; case "Delete User Group": if (entry.getBeforeProperties() != null) { - nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_AUTHORITY_NAME); + nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_AUTHORITY_DISPLAY_NAME); + if (isBlank(nodeName)) + { + nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_AUTHORITY_NAME); + } + } + break; + + case "Add To User Group": + if (entry.getAfterProperties() != null) + { + nodeName = (String) entry.getAfterProperties().get(PARENT_GROUP); + } + break; + + case "Remove From User Group": + if (entry.getBeforeProperties() != null) + { + nodeName = (String) entry.getBeforeProperties().get(PARENT_GROUP); } break; diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java index d8a0422329..faeaff9e4e 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/AddToUserGroupAuditEvent.java @@ -27,13 +27,12 @@ package org.alfresco.module.org_alfresco_module_rm.audit.event; +import static org.alfresco.module.org_alfresco_module_rm.audit.event.UserGroupMembershipUtils.makePropertiesMap; import static org.alfresco.repo.policy.Behaviour.NotificationFrequency.EVERY_EVENT; import java.io.Serializable; -import java.util.HashMap; import java.util.Map; -import org.alfresco.model.ContentModel; import org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; @@ -69,15 +68,7 @@ public class AddToUserGroupAuditEvent extends AuditEvent implements OnCreateChil @Behaviour(kind = BehaviourKind.ASSOCIATION, notificationFrequency = EVERY_EVENT, assocType = "cm:member") public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode) { - Map auditProperties = new HashMap<>(); - auditProperties.put(ContentModel.PROP_AUTHORITY_NAME, - nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_AUTHORITY_NAME)); - auditProperties.put(ContentModel.PROP_USERNAME, - nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_USERNAME)); - // (Ab)use link destination property here, as it vaguely sounds like where the authority ends up. - auditProperties.put(ContentModel.PROP_LINK_DESTINATION, - nodeService.getProperty(childAssocRef.getParentRef(), ContentModel.PROP_AUTHORITY_NAME)); - - recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName(), null, auditProperties); + Map auditProperties = makePropertiesMap(childAssocRef, nodeService); + recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName(), null, auditProperties, true); } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java index 177bf0c75b..81d095dd0e 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/CreateUserGroupAuditEvent.java @@ -67,8 +67,8 @@ public class CreateUserGroupAuditEvent extends AuditEvent implements OnCreateNod public void onCreateNode(ChildAssociationRef childAssocRef) { Map auditProperties = new HashMap<>(); - auditProperties.put(ContentModel.PROP_AUTHORITY_NAME, - nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_AUTHORITY_NAME)); + auditProperties.put(ContentModel.PROP_AUTHORITY_DISPLAY_NAME, + nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_AUTHORITY_DISPLAY_NAME)); recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName(), null, auditProperties); } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java index ce4d2f6bf9..f9d490752d 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/DeleteUserGroupAuditEvent.java @@ -73,8 +73,8 @@ public class DeleteUserGroupAuditEvent extends AuditEvent implements BeforeDelet { // Retrieve the authority name property to be audited Map auditProperties = new HashMap<>(); - auditProperties.put(ContentModel.PROP_AUTHORITY_NAME, - nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHORITY_NAME)); + auditProperties.put(ContentModel.PROP_AUTHORITY_DISPLAY_NAME, + nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHORITY_DISPLAY_NAME)); //audit the property values before the delete event recordsManagementAuditService.auditEvent(nodeRef, getName(), auditProperties, null, true, false); diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/RemoveFromUserGroupAuditEvent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/RemoveFromUserGroupAuditEvent.java new file mode 100644 index 0000000000..bc6a4c9c80 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/RemoveFromUserGroupAuditEvent.java @@ -0,0 +1,74 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ + +package org.alfresco.module.org_alfresco_module_rm.audit.event; + +import static org.alfresco.module.org_alfresco_module_rm.audit.event.UserGroupMembershipUtils.makePropertiesMap; +import static org.alfresco.repo.policy.Behaviour.NotificationFrequency.EVERY_EVENT; + +import java.io.Serializable; +import java.util.Map; + +import org.alfresco.repo.node.NodeServicePolicies.OnDeleteChildAssociationPolicy; +import org.alfresco.repo.policy.annotation.Behaviour; +import org.alfresco.repo.policy.annotation.BehaviourBean; +import org.alfresco.repo.policy.annotation.BehaviourKind; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; + +/** + * Remove an authority from a user group. + * + * @author Tom Page + * @since 2.7 + */ +@BehaviourBean(defaultType = "cm:authorityContainer") +public class RemoveFromUserGroupAuditEvent extends AuditEvent implements OnDeleteChildAssociationPolicy +{ + /** Node Service */ + private NodeService nodeService; + + /** + * Sets the node service + * + * @param nodeService nodeService to set + */ + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + + /** Behaviour to audit removing an authority from a user group. */ + @Override + @Behaviour(kind = BehaviourKind.ASSOCIATION, notificationFrequency = EVERY_EVENT, assocType = "cm:member") + public void onDeleteChildAssociation(ChildAssociationRef childAssocRef) + { + Map auditProperties = makePropertiesMap(childAssocRef, nodeService); + recordsManagementAuditService.auditEvent(childAssocRef.getChildRef(), getName(), auditProperties, null, true); + } +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/UserGroupMembershipUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/UserGroupMembershipUtils.java new file mode 100644 index 0000000000..e9cd231a31 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/event/UserGroupMembershipUtils.java @@ -0,0 +1,92 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ + +package org.alfresco.module.org_alfresco_module_rm.audit.event; + +import static org.apache.commons.lang3.StringUtils.isBlank; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.model.ContentModel; +import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; + +/** + * Utility class for creating audit events about user group membership. + * + * @author Tom Page + * @since 2.7 + */ +public class UserGroupMembershipUtils +{ + /** A QName to display for the parent group's name. */ + public static final QName PARENT_GROUP = QName.createQName(RecordsManagementModel.RM_URI, "Parent Group"); + /** A QName to display for a child group's name. */ + private static final QName CHILD_GROUP = QName.createQName(RecordsManagementModel.RM_URI, "Child Group"); + + /** + * Create a properties map from the given cm:member association. + * + * @param childAssocRef The association to use. + * @param nodeService The node service. + * @return A map containing the names of the parent and child. + */ + public static Map makePropertiesMap(ChildAssociationRef childAssocRef, NodeService nodeService) + { + Map auditProperties = new HashMap<>(); + // Set exactly one of the child group property or the child user name property. + String childGroupName = getUserGroupName(childAssocRef.getChildRef(), nodeService); + if (!isBlank(childGroupName)) + { + auditProperties.put(CHILD_GROUP, childGroupName); + } + String childUserName = (String) nodeService.getProperty(childAssocRef.getChildRef(), ContentModel.PROP_USERNAME); + if (!isBlank(childUserName)) + { + auditProperties.put(ContentModel.PROP_USERNAME, childUserName); + } + // Set the parent group name. + auditProperties.put(PARENT_GROUP, getUserGroupName(childAssocRef.getParentRef(), nodeService)); + return auditProperties; + } + + /** Get a name that can be displayed for the user group. */ + private static String getUserGroupName(NodeRef nodeRef, NodeService nodeService) + { + String groupName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHORITY_DISPLAY_NAME); + if (isBlank(groupName)) + { + groupName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHORITY_NAME); + } + return groupName; + } +} From 305ca8f029af5a0529878152b1625e728d6c5fe1 Mon Sep 17 00:00:00 2001 From: cagache Date: Wed, 25 Apr 2018 16:40:35 +0300 Subject: [PATCH 05/29] RM-5236 Added tests for audit group events --- .../rm/community/model/audit/AuditEvents.java | 8 +- .../audit/AuditGroupEventsTests.java | 159 ++++++++++++++++++ 2 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java index 144520abd4..76c2295b29 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java @@ -35,8 +35,12 @@ package org.alfresco.rest.rm.community.model.audit; */ public enum AuditEvents { - CREATE_PERSON("Create Person","Create User"), - DELETE_PERSON("Delete Person","Delete User"); + CREATE_PERSON("Create Person", "Create User"), + DELETE_PERSON("Delete Person", "Delete User"), + CREATE_USER_GROUP("Create User Group", "Create User Group"), + DELETE_USER_GROUP("Delete User Group", "Delete User Group"), + ADD_TO_USER_GROUP("Add To User Group", "Add To User Group"), + REMOVE_FROM_USER_GROUP("Remove From User Group", "Remove From User Group"); /** event audited */ public final String event; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java new file mode 100644 index 0000000000..c63d0452fd --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java @@ -0,0 +1,159 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * License rights for this program may be obtained from Alfresco Software, Ltd. + * pursuant to a written agreement and any use of this program without such an + * agreement is prohibited. + * #L% + */ +package org.alfresco.rest.rm.community.audit; + +import static org.alfresco.rest.rm.community.model.audit.AuditEvents.ADD_TO_USER_GROUP; +import static org.alfresco.rest.rm.community.model.audit.AuditEvents.CREATE_USER_GROUP; +import static org.alfresco.rest.rm.community.model.audit.AuditEvents.DELETE_USER_GROUP; +import static org.alfresco.rest.rm.community.model.audit.AuditEvents.REMOVE_FROM_USER_GROUP; +import static org.alfresco.utility.report.log.Step.STEP; +import static org.testng.AssertJUnit.assertTrue; + +import java.util.List; + +import com.google.common.collect.ImmutableMap; + +import org.alfresco.rest.rm.community.base.BaseRMRestTest; +import org.alfresco.rest.rm.community.model.audit.AuditEntry; +import org.alfresco.rest.v0.RMAuditAPI; +import org.alfresco.test.AlfrescoTest; +import org.alfresco.utility.model.GroupModel; +import org.alfresco.utility.model.UserModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * This class contains the tests that check the group events are audited + * + * @author Claudia Agache + * @since 2.7 + */ +@AlfrescoTest (jira = "RM-5236") +public class AuditGroupEventsTests extends BaseRMRestTest +{ + @Autowired + private RMAuditAPI rmAuditAPI; + + private GroupModel testGroup; + private UserModel testUser; + + @BeforeClass (alwaysRun = true) + public void cleanAuditLogs() + { + //clean audit logs + rmAuditAPI.clearAuditLog(getAdminUser().getPassword(), getAdminUser().getPassword()); + } + + /** + * Given I have created a new group + * When I view the RM audit + * Then there is an entry showing that I created a group + */ + @Test + public void createGroupEventIsAudited() + { + testGroup = dataGroup.createRandomGroup(); + + STEP("Get the list of audit entries for the create group event."); + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + getAdminUser().getPassword(), 100, CREATE_USER_GROUP.event); + + STEP("Check the audit log contains only the entries for the created group."); + assertTrue("The list of events is not filtered by " + CREATE_USER_GROUP.event, + auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(CREATE_USER_GROUP.eventDisplayName))); + + assertTrue("The group name for the new group created is not audited.", + auditEntries.stream().filter(auditEntry -> auditEntry.getEvent().equals(CREATE_USER_GROUP.eventDisplayName)) + .anyMatch(auditEntry -> auditEntry.getNodeName().equals(testGroup.getGroupIdentifier()))); + } + + /** + * Given I have added a user to a group + * When I view the RM audit + * Then there is an entry showing that I have added a user to a group + */ + @Test + public void addUserToGroupEventIsAudited() + { + testGroup = dataGroup.createRandomGroup(); + testUser = getDataUser().createRandomTestUser(); + dataGroup.usingUser(testUser).addUserToGroup(testGroup); + + STEP("Get the list of audit entries for the add user to group event."); + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + getAdminUser().getPassword(), 100, ADD_TO_USER_GROUP.event); + + STEP("Check the audit log contains only the entries for the add user to group event."); + assertTrue("The list of events is not filtered by " + ADD_TO_USER_GROUP.event, + auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(ADD_TO_USER_GROUP.eventDisplayName))); + + assertTrue("The username and destination group are not audited.", + auditEntries.stream().filter(auditEntry -> auditEntry.getEvent().equals(ADD_TO_USER_GROUP.eventDisplayName)) + .anyMatch(auditEntry -> auditEntry.getNodeName().equals(testGroup.getGroupIdentifier()) + && auditEntry.getChangedValues().contains(ImmutableMap.of("new", testUser.getUsername(), "previous", "", "name", "User Name")) + && auditEntry.getChangedValues().contains(ImmutableMap.of("new", testGroup.getGroupIdentifier(), "previous", "", "name", "Parent Group")))); + } + + /** + * Given I have removed a user from a group + * When I view the RM audit + * Then there is an entry showing that I have removed a user from a group + */ + @Test + public void removeUserFromGroupEventIsAudited() + { + testGroup = dataGroup.createRandomGroup(); + testUser = getDataUser().createRandomTestUser(); + dataGroup.usingUser(testUser).addUserToGroup(testGroup); + dataGroup.removeUserFromGroup(testGroup, testUser); + + STEP("Get the list of audit entries for the add user to group event."); + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + getAdminUser().getPassword(), 100, REMOVE_FROM_USER_GROUP.event); + + STEP("Check the audit log contains only the entries for the remove user from group event."); + assertTrue("The list of events is not filtered by " + REMOVE_FROM_USER_GROUP.event, + auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(REMOVE_FROM_USER_GROUP.eventDisplayName))); + + assertTrue("The username and previous parent group are not audited.", + auditEntries.stream().filter(auditEntry -> auditEntry.getEvent().equals(REMOVE_FROM_USER_GROUP.eventDisplayName)) + .anyMatch(auditEntry -> auditEntry.getNodeName().equals(testGroup.getGroupIdentifier()) + && auditEntry.getChangedValues().contains(ImmutableMap.of("new", "", "previous", testUser.getUsername(), "name", "User Name")) + && auditEntry.getChangedValues().contains(ImmutableMap.of("new", "","previous", testGroup.getGroupIdentifier(), "name", "Parent Group")))); + } + + /** + * Given I have deleted a group + * When I view the RM audit + * Then there is an entry showing that I have deleted a group + */ + @Test + public void deleteGroupEventIsAudited() + { + testGroup = dataGroup.createRandomGroup(); + dataGroup.deleteGroup(testGroup); + + STEP("Get the list of audit entries for the delete group event."); + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + getAdminUser().getPassword(), 100, DELETE_USER_GROUP.event); + + STEP("Check the audit log contains only the entries for the created group."); + assertTrue("The list of events is not filtered by " + DELETE_USER_GROUP.event, + auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(DELETE_USER_GROUP.eventDisplayName))); + + assertTrue("The group name for the deleted group is not audited.", + auditEntries.stream().filter(auditEntry -> auditEntry.getEvent().equals(DELETE_USER_GROUP.eventDisplayName)) + .anyMatch(auditEntry -> auditEntry.getNodeName().equals(testGroup.getGroupIdentifier()) + && auditEntry.getChangedValues().contains(ImmutableMap.of("new", "", "previous", testGroup.getGroupIdentifier(), "name", "authorityDisplayName")))); + } +} From 9d202d2a9db214bb9777bbf5fa1dbdef9b88c310 Mon Sep 17 00:00:00 2001 From: cagache Date: Wed, 25 Apr 2018 16:50:07 +0300 Subject: [PATCH 06/29] fix license --- .../audit/AuditGroupEventsTests.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java index c63d0452fd..e8a427aec2 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java @@ -4,9 +4,24 @@ * %% * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . * #L% */ package org.alfresco.rest.rm.community.audit; From 15dee7f2bff230a4b7f92072998af71bdfc20848 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Thu, 26 Apr 2018 15:49:07 +0100 Subject: [PATCH 07/29] RM-5236 Refactor common code when getting node name. --- .../RecordsManagementAuditServiceImpl.java | 63 +++++++++---------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java index 255b59d09b..f4f13ac43f 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java @@ -27,6 +27,9 @@ package org.alfresco.module.org_alfresco_module_rm.audit; +import static org.alfresco.model.ContentModel.PROP_AUTHORITY_DISPLAY_NAME; +import static org.alfresco.model.ContentModel.PROP_AUTHORITY_NAME; +import static org.alfresco.model.ContentModel.PROP_USERNAME; import static org.alfresco.module.org_alfresco_module_rm.audit.event.UserGroupMembershipUtils.PARENT_GROUP; import static org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model.TYPE_DOD_5015_SITE; import static org.alfresco.module.org_alfresco_module_rm.model.rma.type.RmSiteType.DEFAULT_SITE_NAME; @@ -1580,61 +1583,35 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean switch (entry.getEvent()) { case "Create Person": - if (entry.getAfterProperties() != null) - { - nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_USERNAME); - } + nodeName = getNodeName(entry.getAfterProperties(), PROP_USERNAME); // This is needed as older audit events (pre-2.7) were created without PROP_USERNAME being set. NodeRef nodeRef = entry.getNodeRef(); if (nodeName == null && nodeService.exists(nodeRef)) { - nodeName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME); + nodeName = (String) nodeService.getProperty(nodeRef, PROP_USERNAME); } json.put("createPerson", true); break; case "Delete Person": - if (entry.getBeforeProperties() != null) - { - nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_USERNAME); - } + nodeName = getNodeName(entry.getBeforeProperties(), PROP_USERNAME); json.put("deletePerson", true); break; case "Create User Group": - if (entry.getAfterProperties() != null) - { - nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_AUTHORITY_DISPLAY_NAME); - if (isBlank(nodeName)) - { - nodeName = (String) entry.getAfterProperties().get(ContentModel.PROP_AUTHORITY_NAME); - } - } + nodeName = getNodeName(entry.getAfterProperties(), PROP_AUTHORITY_DISPLAY_NAME, PROP_AUTHORITY_NAME); break; case "Delete User Group": - if (entry.getBeforeProperties() != null) - { - nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_AUTHORITY_DISPLAY_NAME); - if (isBlank(nodeName)) - { - nodeName = (String) entry.getBeforeProperties().get(ContentModel.PROP_AUTHORITY_NAME); - } - } + nodeName = getNodeName(entry.getBeforeProperties(), PROP_AUTHORITY_DISPLAY_NAME, PROP_AUTHORITY_NAME); break; case "Add To User Group": - if (entry.getAfterProperties() != null) - { - nodeName = (String) entry.getAfterProperties().get(PARENT_GROUP); - } + nodeName = getNodeName(entry.getAfterProperties(), PARENT_GROUP); break; case "Remove From User Group": - if (entry.getBeforeProperties() != null) - { - nodeName = (String) entry.getBeforeProperties().get(PARENT_GROUP); - } + nodeName = getNodeName(entry.getBeforeProperties(), PARENT_GROUP); break; default: @@ -1645,6 +1622,26 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean json.put("nodeName", nodeName == null ? "" : nodeName); } + /** + * Get a node name using the first non-blank value from a properties object using a list of property names. + * + * @param properties The properties object. + * @param propertyNames The names of the properties to use. Return the first value that is not empty. + * @return The value of the property, or null if it's not there. + */ + private String getNodeName(Map properties, QName... propertyNames) + { + for (QName propertyName : propertyNames) + { + String nodeName = (properties != null ? (String) properties.get(propertyName) : null); + if (!isBlank(nodeName)) + { + return nodeName; + } + } + return null; + } + /** * Helper method to convert value to MLText * From 66afb7162b415568f802cadcbcc39288a9384eb7 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Fri, 27 Apr 2018 14:49:01 +0100 Subject: [PATCH 08/29] GERMAN: Updated German bundle based on EN-RM-rev2018-04-27T090855 --- .../messages/audit-service_de.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_de.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_de.properties index d4966d4856..6510945861 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_de.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_de.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=Anmeldung erfolgreich rm.audit.login-failed=Anmeldung fehlgeschlagen rm.audit.create-person=Benutzer anlegen rm.audit.delete-person=Benutzer l\u00f6schen +rm.audit.create-userGroup=Benutzergruppe erstellen +rm.audit.delete-userGroup=Benutzergruppe l\u00f6schen +rm.audit.addMember=Zu Benutzergruppe hinzuf\u00fcgen +rm.audit.removeMember=Von Benutzergruppe entfernen rm.audit.linkTo=Link zu rm.audit.moveTo=Verschieben nach rm.audit.copyTo=Kopieren nach From ee32d625c1b8edd8a73327923b686bc3f267d243 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Fri, 27 Apr 2018 15:08:11 +0100 Subject: [PATCH 09/29] SPANISH: Updated Spanish bundle based on EN-RM-rev2018-04-27T090855 --- .../messages/audit-service_es.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_es.properties index 230f3559ec..c1d33f0594 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_es.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=Inicio de sesi\u00f3n correcto rm.audit.login-failed=Error de inicio de sesi\u00f3n rm.audit.create-person=Crear usuario rm.audit.delete-person=Eliminar usuario +rm.audit.create-userGroup=Crear grupo de usuarios +rm.audit.delete-userGroup=Eliminar grupo de usuarios +rm.audit.addMember=A\u00f1adir a grupo de usuarios +rm.audit.removeMember=Eliminar de grupo de usuarios rm.audit.linkTo=Enlace a rm.audit.moveTo=Mover a rm.audit.copyTo=Copiar a From 89c48f384d4471d1a474bc33f512e399907c4f84 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Fri, 27 Apr 2018 15:10:08 +0100 Subject: [PATCH 10/29] FRENCH: Updated French bundle based on EN-RM-rev2018-04-27T090855 --- .../messages/audit-service_fr.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_fr.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_fr.properties index 88b86711fa..7ea74aa30c 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_fr.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_fr.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=La connexion a abouti rm.audit.login-failed=La connexion a \u00e9chou\u00e9 rm.audit.create-person=Cr\u00e9er un utilisateur rm.audit.delete-person=Supprimer un utilisateur +rm.audit.create-userGroup=Cr\u00e9er un groupe d'utilisateur +rm.audit.delete-userGroup=Supprimer le groupe d'utilisateur +rm.audit.addMember=Ajouter au groupe d'utilisateur +rm.audit.removeMember=Supprimer du groupe d'utilisateur rm.audit.linkTo=Lier \u00e0 rm.audit.moveTo=D\u00e9placer vers... rm.audit.copyTo=Copier vers... From ee65a572c4a51b8badec95e897fa0727d72e17fb Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Fri, 27 Apr 2018 15:12:45 +0100 Subject: [PATCH 11/29] ITALIAN: Updated Italian bundle based on EN-RM-rev2018-04-27T090855 --- .../messages/audit-service_it.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_it.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_it.properties index 78fe2071d6..592d2ccaf5 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_it.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_it.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=Login riuscito rm.audit.login-failed=Login non riuscito rm.audit.create-person=Crea utente rm.audit.delete-person=Elimina utente +rm.audit.create-userGroup=Crea gruppo utenti +rm.audit.delete-userGroup=Elimina gruppo utenti +rm.audit.addMember=Aggiungi al gruppo utenti +rm.audit.removeMember=Rimuovi dal gruppo utenti rm.audit.linkTo=Collega a rm.audit.moveTo=Sposta in rm.audit.copyTo=Copia in From 3aba6a0122d8fd15b85c602f51564f6ee7889b97 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Fri, 27 Apr 2018 15:13:31 +0100 Subject: [PATCH 12/29] DUTCH: Updated Dutch bundle based on EN-RM-rev2018-04-27T090855 --- .../messages/audit-service_nl.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nl.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nl.properties index c4cf83c5ca..57ea711c49 100755 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nl.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nl.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=Aanmelden geslaagd rm.audit.login-failed=Aanmelden niet geslaagd rm.audit.create-person=Gebruiker maken rm.audit.delete-person=Gebruiker verwijderen +rm.audit.create-userGroup=Gebruikersgroep maken +rm.audit.delete-userGroup=Gebruikersgroep verwijderen +rm.audit.addMember=Toevoegen aan gebruikersgroep +rm.audit.removeMember=Verwijderen uit gebruikersgroep rm.audit.linkTo=Koppelen naar rm.audit.moveTo=Verplaatsen naar rm.audit.copyTo=Kopi\u00ebren naar From f442866e9816e3548f146d7aa2cd28b7c626d682 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Fri, 27 Apr 2018 15:17:10 +0100 Subject: [PATCH 13/29] RUSSIAN: Updated Italian bundle based on EN-RM-rev2018-04-27T090855 --- .../messages/audit-service_ru.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ru.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ru.properties index 9725da5f83..74c68ee760 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ru.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ru.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=\u0412\u0445\u043e\u0434 \u0443\u0441\u043f\u0435\u0448 rm.audit.login-failed=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 rm.audit.create-person=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f rm.audit.delete-person=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f +rm.audit.create-userGroup=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 +rm.audit.delete-userGroup=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 +rm.audit.addMember=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 +rm.audit.removeMember=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 rm.audit.linkTo=\u0421\u0432\u044f\u0437\u0430\u0442\u044c \u0441 rm.audit.moveTo=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 rm.audit.copyTo=\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 From a5d892d83a27e449182335665d60b40483511504 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Fri, 27 Apr 2018 15:18:31 +0100 Subject: [PATCH 14/29] BRAZILIAN PORTUGUESE: Updated Italian bundle based on EN-RM-rev2018-04-27T090855 --- .../messages/audit-service_pt_BR.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_pt_BR.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_pt_BR.properties index 7e8b334b39..8b95f07838 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_pt_BR.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_pt_BR.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=Login bem-sucedido rm.audit.login-failed=Login malsucedido rm.audit.create-person=Criar usu\u00e1rio rm.audit.delete-person=Excluir usu\u00e1rio +rm.audit.create-userGroup=Criar grupo de usu\u00e1rios +rm.audit.delete-userGroup=Excluir grupo de usu\u00e1rios +rm.audit.addMember=Adicionar ao grupo de usu\u00e1rios +rm.audit.removeMember=Remover do grupo de usu\u00e1rios rm.audit.linkTo=Vincular a rm.audit.moveTo=Mover para rm.audit.copyTo=Copiar para From 0f898ae622721e9d353504ef82ece906fcfa7bd1 Mon Sep 17 00:00:00 2001 From: Ross Gale Date: Fri, 27 Apr 2018 15:36:18 +0100 Subject: [PATCH 15/29] Update rm-events.properties adding string for declassification review --- .../org_alfresco_module_rm/messages/rm-events.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events.properties index ea0094fc86..329c771aa4 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events.properties @@ -19,4 +19,5 @@ rmevent.obsolete=Obsolete rmevent.all_allowances_granted_are_terminated=All Allowances Granted are Terminated rmevent.WGI_action_complete=WGI Action Complete rmevent.separation=Separation -rmevent.case_complete=Case Complete \ No newline at end of file +rmevent.case_complete=Case Complete +rmevent.declassification_review=Declassification Review \ No newline at end of file From 527a79acf2497529106375d0208cedf95dcb6e16 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Mon, 30 Apr 2018 10:08:19 +0300 Subject: [PATCH 16/29] RM-5234 Fix Login filter --- .../audit/RecordsManagementAuditServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java index f4f13ac43f..6b46eb4e9c 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java @@ -1107,7 +1107,19 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean } else if (params.getEvent() != null) { - auditQueryParams.addSearchKey(RM_AUDIT_DATA_EVENT_NAME, params.getEvent()); + if (params.getEvent().equalsIgnoreCase("Login.Success")) + { + auditQueryParams.addSearchKey(RM_AUDIT_DATA_LOGIN_FULLNAME, null); + } + else + if (params.getEvent().equalsIgnoreCase("Login.Failure")) + { + auditQueryParams.addSearchKey(RM_AUDIT_DATA_LOGIN_ERROR, null); + } + else + { + auditQueryParams.addSearchKey(RM_AUDIT_DATA_EVENT_NAME, params.getEvent()); + } } // Get audit entries From 065dd3a41e5ac8e833ddb340fb62c1c613053c52 Mon Sep 17 00:00:00 2001 From: cagache Date: Mon, 30 Apr 2018 12:42:29 +0300 Subject: [PATCH 17/29] RM-5234 Check that user can filter the audit logs by Login successful and Login unsuccessful events --- .../rm/community/model/audit/AuditEvents.java | 3 +- .../audit/AuditGroupEventsTests.java | 10 +-- .../rm/community/audit/AuditLoginEvents.java | 82 +++++++++++++++++++ .../community/audit/AuditUserEventsTests.java | 4 +- 4 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditLoginEvents.java diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java index 76c2295b29..410af7c587 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java @@ -40,7 +40,8 @@ public enum AuditEvents CREATE_USER_GROUP("Create User Group", "Create User Group"), DELETE_USER_GROUP("Delete User Group", "Delete User Group"), ADD_TO_USER_GROUP("Add To User Group", "Add To User Group"), - REMOVE_FROM_USER_GROUP("Remove From User Group", "Remove From User Group"); + REMOVE_FROM_USER_GROUP("Remove From User Group", "Remove From User Group"), + LOGIN_UNSUCCESSFUL("Login Unsuccessful", "Login Unsuccessful"); /** event audited */ public final String event; diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java index e8a427aec2..aaa5f569c0 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditGroupEventsTests.java @@ -66,7 +66,7 @@ public class AuditGroupEventsTests extends BaseRMRestTest public void cleanAuditLogs() { //clean audit logs - rmAuditAPI.clearAuditLog(getAdminUser().getPassword(), getAdminUser().getPassword()); + rmAuditAPI.clearAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword()); } /** @@ -80,7 +80,7 @@ public class AuditGroupEventsTests extends BaseRMRestTest testGroup = dataGroup.createRandomGroup(); STEP("Get the list of audit entries for the create group event."); - List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword(), 100, CREATE_USER_GROUP.event); STEP("Check the audit log contains only the entries for the created group."); @@ -105,7 +105,7 @@ public class AuditGroupEventsTests extends BaseRMRestTest dataGroup.usingUser(testUser).addUserToGroup(testGroup); STEP("Get the list of audit entries for the add user to group event."); - List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword(), 100, ADD_TO_USER_GROUP.event); STEP("Check the audit log contains only the entries for the add user to group event."); @@ -133,7 +133,7 @@ public class AuditGroupEventsTests extends BaseRMRestTest dataGroup.removeUserFromGroup(testGroup, testUser); STEP("Get the list of audit entries for the add user to group event."); - List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword(), 100, REMOVE_FROM_USER_GROUP.event); STEP("Check the audit log contains only the entries for the remove user from group event."); @@ -159,7 +159,7 @@ public class AuditGroupEventsTests extends BaseRMRestTest dataGroup.deleteGroup(testGroup); STEP("Get the list of audit entries for the delete group event."); - List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword(), 100, DELETE_USER_GROUP.event); STEP("Check the audit log contains only the entries for the created group."); diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditLoginEvents.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditLoginEvents.java new file mode 100644 index 0000000000..f138872ee1 --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditLoginEvents.java @@ -0,0 +1,82 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.rest.rm.community.audit; + +import static org.alfresco.rest.rm.community.model.audit.AuditEvents.LOGIN_UNSUCCESSFUL; +import static org.alfresco.utility.report.log.Step.STEP; +import static org.testng.AssertJUnit.assertTrue; + +import java.util.List; + +import org.alfresco.rest.rm.community.base.BaseRMRestTest; +import org.alfresco.rest.rm.community.model.audit.AuditEntry; +import org.alfresco.rest.v0.RMAuditAPI; +import org.alfresco.test.AlfrescoTest; +import org.alfresco.utility.model.UserModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * This class contains the tests that check the login events are audited + * + * @author Claudia Agache + * @since 2.7 + */ +@AlfrescoTest (jira = "RM-5234") +public class AuditLoginEvents extends BaseRMRestTest +{ + @Autowired + private RMAuditAPI rmAuditAPI; + + @BeforeClass (alwaysRun = true) + public void cleanAuditLogs() + { + //clean audit logs + rmAuditAPI.clearAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword()); + } + + /** + * Given I have tried to login using invalid credentials + * When I view the RM audit filtered by Login unsuccessful event + * Then the audit log contains only the entries for the Login unsuccessful event + */ + @Test + public void filterByLoginUnsuccessful() throws Exception + { + restClient.authenticateUser(new UserModel(getAdminUser().getUsername(), "InvalidPassword")); + restClient.withCoreAPI().getSites(); + + STEP("Get the list of audit entries for the login unsuccessful event."); + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getUsername(), + getAdminUser().getPassword(), 100, LOGIN_UNSUCCESSFUL.event); + + STEP("Check the audit log contains only the entries for the login unsuccessful event."); + assertTrue("The list of events is not filtered by " + LOGIN_UNSUCCESSFUL.event, + auditEntries.stream().allMatch(auditEntry -> auditEntry.getEvent().equals(LOGIN_UNSUCCESSFUL.eventDisplayName))); + } +} diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditUserEventsTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditUserEventsTests.java index 33af49b2c9..821f4f1974 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditUserEventsTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/audit/AuditUserEventsTests.java @@ -73,7 +73,7 @@ public class AuditUserEventsTests extends BaseRMRestTest createUser = getDataUser().createUser(userName); STEP("Get the list of audit entries for the create person event."); - List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getPassword(), + List auditEntries = rmAuditAPI.getRMAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword(), 100, CREATE_PERSON.event); STEP("Check the audit log contains only the entries for the created user."); @@ -89,7 +89,7 @@ public class AuditUserEventsTests extends BaseRMRestTest public void cleanAuditLogs() { //clean audit logs - rmAuditAPI.clearAuditLog(getAdminUser().getPassword(), getAdminUser().getPassword()); + rmAuditAPI.clearAuditLog(getAdminUser().getUsername(), getAdminUser().getPassword()); } @AfterClass (alwaysRun = true) From a8f49a325725f963bdc2bf8cbdfa54b0f97c653e Mon Sep 17 00:00:00 2001 From: cagache Date: Mon, 30 Apr 2018 15:54:46 +0300 Subject: [PATCH 18/29] review changes --- .../org/alfresco/rest/rm/community/model/audit/AuditEvents.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java index 410af7c587..8fd6606f1b 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/audit/AuditEvents.java @@ -41,7 +41,7 @@ public enum AuditEvents DELETE_USER_GROUP("Delete User Group", "Delete User Group"), ADD_TO_USER_GROUP("Add To User Group", "Add To User Group"), REMOVE_FROM_USER_GROUP("Remove From User Group", "Remove From User Group"), - LOGIN_UNSUCCESSFUL("Login Unsuccessful", "Login Unsuccessful"); + LOGIN_UNSUCCESSFUL("Login.Failure", "Login Unsuccessful"); /** event audited */ public final String event; From 90c41d21bf9d560e494191e69aec54665a69e3b3 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:06:37 +0100 Subject: [PATCH 19/29] GERMAN: Updated German bundle based on EN-RM-rev2018-04-30T100445 --- .../org_alfresco_module_rm/messages/rm-events_de.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_de.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_de.properties index c32122a8c3..f17930380b 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_de.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_de.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=Alle einger\u00e4umten Berechtigun rmevent.WGI_action_complete=WGI-Aktion abschlie\u00dfen rmevent.separation=Trennung rmevent.case_complete=Fall abgeschlossen +rmevent.declassification_review=Deklassifizierungs\u00fcberpr\u00fcfung From 0b55ac94bac60642a66e10d947521bead0343875 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:07:27 +0100 Subject: [PATCH 20/29] SPANISH: Updated Spanish bundle based on EN-RM-rev2018-04-30T100445 --- .../dod5015/messages/dod5015-model_es.properties | 4 ++-- .../messages/action-service_es.properties | 2 +- .../org_alfresco_module_rm/messages/actions_es.properties | 6 +++--- .../messages/capability-service_es.properties | 4 ++-- .../messages/records-management-service_es.properties | 8 ++++---- .../messages/records-model_es.properties | 4 ++-- .../messages/rm-events_es.properties | 1 + 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/dod5015/messages/dod5015-model_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/dod5015/messages/dod5015-model_es.properties index 66fdf31fdf..e77499dd40 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/dod5015/messages/dod5015-model_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/dod5015/messages/dod5015-model_es.properties @@ -3,8 +3,8 @@ dod_dod5015.description=Modelo de contenido de DOD5015 dod_dod5015.type.dod_site.title=Sitio de DOD5015 dod_dod5015.type.dod_site.description=Sitio de DOD5015 -dod_dod5015.type.dod_filePlan.title=Plan de ficheros DOD5015 -dod_dod5015.type.dod_filePlan.description=Plan de ficheros DOD5015 +dod_dod5015.type.dod_filePlan.title=Cuadro de clasificaci\u00f3n DOD5015 +dod_dod5015.type.dod_filePlan.description=Cuadro de clasificaci\u00f3n DOD5015 dod_dod5015.type.dod_recordSeries.title=Serie de documentos de archivo (depreciada) dod_dod5015.type.dod_recordSeries.description=Serie de documentos de archivo (depreciada) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service_es.properties index 43372c3d11..06a16b7eb5 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service_es.properties @@ -37,7 +37,7 @@ rm.action.event-not-undone=No puede deshacer el evento {0} porque no se ha defin rm.action.node-not-record-category=No puede crear una planificaci\u00f3n de retenci\u00f3n para ({0}) porque no es una categor\u00eda de documento de archivo. rm.action.parameter-not-supplied=A\u00f1ada un ''{0}'' para continuar. rm.action.delete-not-hold-type=No se pudo eliminar el bloqueo porque {1} no es del tipo {0}. -rm.action.cast-to-rm-type=No puede cargar un tipo de carpeta personalizada al plan de ficheros de Records Management. +rm.action.cast-to-rm-type=No puede cargar un tipo de carpeta personalizada al cuadro de clasificaci\u00f3n de Records Management. rm.action.record-folder-create=No puede crear una carpeta de documentos de archivo en otra carpeta de documentos de archivo. rm.action.unique.child.type-error-message=No puede crear elementos m\u00faltiples de este tipo aqu\u00ed. rm.action.multiple.children.type-error-message=No puede crear {0} aqu\u00ed. diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions_es.properties index 763236b1f2..86300201bd 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/actions_es.properties @@ -35,7 +35,7 @@ hasDispositionAction.description=Los documentos de archivo y las carpetas tienen # Are kind isKind.title=Tipo de elemento de Records Management -isKind.description=Los elementos son una clase de componente del plan de ficheros +isKind.description=Los elementos son una clase de componente del cuadro de clasificaci\u00f3n isKind.kind.display-label=Clase # Are Record Type @@ -49,12 +49,12 @@ isRecordType.description=Los documentos de archivo tienen un tipo de documento d # Declare As Record create-record.title=Declarar como documento de archivo create-record.description=Declara el fichero como un documento de archivo -create-record.file-plan.display-label=Plan de ficheros +create-record.file-plan.display-label=Cuadro de clasificaci\u00f3n create-record.hide-record.display-label=Ocultar documento de archivo # Declare As Version Record declare-as-version-record.title=Declarar la versi\u00f3n como documento de archivo declare-as-version-record.description=Declara esta versi\u00f3n del fichero como un documento de archivo -declare-as-version-record.file-plan.display-label=Plan de ficheros +declare-as-version-record.file-plan.display-label=Cuadro de clasificaci\u00f3n # Complete record declareRecord.title=Documento de archivo completo declareRecord.description=Completa un documento de archivo diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/capability-service_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/capability-service_es.properties index 4dfde5c077..4531ab069f 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/capability-service_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/capability-service_es.properties @@ -90,8 +90,8 @@ capability.ManageAccessRights.title=Administrar permisos # Configuration capability.group.config.title=Configuraci\u00f3n -capability.CreateModifyDestroyFileplanMetadata.title=Crear Modificar Destruir metadatos de plan de ficheros -capability.CreateModifyDestroyFileplanTypes.title=Crear Modificar Destruir tipos de plan de ficheros +capability.CreateModifyDestroyFileplanMetadata.title=Crear Modificar Destruir metadatos del cuadro de clasificaci\u00f3n +capability.CreateModifyDestroyFileplanTypes.title=Crear Modificar Destruir tipos del cuadro de clasificaci\u00f3n capability.CreateModifyDestroyRecordTypes.title=Crear Modificar Destruir tipos de documento de archivo capability.CreateAndAssociateSelectionLists.title=Crear y asociar listas de selecci\u00f3n capability.EditSelectionLists.title=Editar listas de selecci\u00f3n diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-management-service_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-management-service_es.properties index ada52e23cb..2e1575538f 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-management-service_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-management-service_es.properties @@ -4,10 +4,10 @@ rm.service.set-id=No puede cambiar el ID de {0} porque es de solo lectura. rm.service.path-node=No se pudo encontrar {0}. Trate de actualizar el navegador o p\u00f3ngase en contacto con el dep. de TI. rm.service.invalid-rm-node=El nodo de Records Management no es v\u00e1lido porque el aspecto {0} no est\u00e1 presente. rm.service.no-root=No se pudo encontrar la ra\u00edz de Records Management. Trate de archivar el documento de archivo de nuevo. -rm.service.dup-root=No puede crear un plan de ficheros aqu\u00ed porque ya hay uno creado en esta jerarqu\u00eda de carpetas. -rm.service.root-type=No se puede crear el plan de ficheros porque el tipo {0} no es un subtipo de rma:filePlan. Vuelva a intentarlo usando un tipo diferente. -rm.service.container-parent-type=Solo puede crear una categor\u00eda de documentos de archivo en el nivel superior del plan de ficheros o en otra categor\u00eda de documentos de archivo (rma:recordCategory). -rm.service.container-type=Solo puede crear una categor\u00eda de documentos de archivo en el nivel superior del plan de ficheros o en otra categor\u00eda de documentos de archivo (rma:recordsManagementContainer o subtipo). +rm.service.dup-root=No puede crear un cuadro de clasificaci\u00f3n aqu\u00ed porque ya hay uno creado en esta jerarqu\u00eda de carpetas. +rm.service.root-type=No se puede crear el cuadro de clasificaci\u00f3n porque el tipo {0} no es un subtipo de rma:filePlan. Vuelva a intentarlo usando un tipo diferente. +rm.service.container-parent-type=Solo puede crear una categor\u00eda de documentos de archivo en el nivel superior del cuadro de clasificaci\u00f3n o en otra categor\u00eda de documentos de archivo (rma:recordCategory). +rm.service.container-type=Solo puede crear una categor\u00eda de documentos de archivo en el nivel superior del cuadro de clasificaci\u00f3n o en otra categor\u00eda de documentos de archivo (rma:recordsManagementContainer o subtipo). rm.service.container-expected=Solo puede encontrar contenidos de categor\u00eda de documentos de archivo en una categor\u00eda de documentos de archivo (rma:recordCategory o subtipo). rm.service.record-folder-expected=La acci\u00f3n solo puede completarse usando una carpeta de documentos de archivo del tipo rma:recordFolder. rm.service.parent-record-folder-root=No puede crear una carpeta de documentos de archivo aqu\u00ed. Trate de crearla en una categor\u00eda de documentos de archivo. diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-model_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-model_es.properties index 822a18d2ac..742a37394b 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-model_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/records-model_es.properties @@ -122,8 +122,8 @@ rma_recordsmanagement.property.rma_transferLocation.decription=Transferencia de rma_recordsmanagement.association.rma_transferred.title=Transferido rma_recordsmanagement.association.rma_transferred.decription=Transferido -rma_recordsmanagement.aspect.rma_filePlanComponent.title=Componente del plan de ficheros -rma_recordsmanagement.aspect.rma_filePlanComponent.decription=Componente del plan de ficheros +rma_recordsmanagement.aspect.rma_filePlanComponent.title=Componente del cuadro de clasificaci\u00f3n +rma_recordsmanagement.aspect.rma_filePlanComponent.decription=Componente del cuadro de clasificaci\u00f3n rma_recordsmanagement.property.rma_rootNodeRef.title=Nodo ra\u00edz rma_recordsmanagement.property.rma_rootNodeRef.decription=Nodo ra\u00edz diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_es.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_es.properties index 56c41fb451..e752aac231 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_es.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_es.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=Todas las provisiones otorgadas ha rmevent.WGI_action_complete=Acci\u00f3n WGI completa rmevent.separation=Separaci\u00f3n rmevent.case_complete=Caso completo +rmevent.declassification_review=Revisi\u00f3n de la desclasificaci\u00f3n From 1e70401e8636c64365593a1b768e343f50e1ad6e Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:08:17 +0100 Subject: [PATCH 21/29] FRENCH: Updated French bundle based on EN-RM-rev2018-04-30T100445 --- .../org_alfresco_module_rm/messages/rm-events_fr.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_fr.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_fr.properties index 4e0f2a72a9..9a7633d558 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_fr.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_fr.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=Toutes les autorisations accord\u0 rmevent.WGI_action_complete=Action WGI termin\u00e9e rmevent.separation=S\u00e9paration rmevent.case_complete=Cas termin\u00e9 +rmevent.declassification_review=V\u00e9rification de d\u00e9classification From e406b7831fee927ed24d4ff0edaff0e91d27ebd5 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:08:50 +0100 Subject: [PATCH 22/29] ITALIAN: Updated Italian bundle based on EN-RM-rev2018-04-30T100445 --- .../org_alfresco_module_rm/messages/rm-events_it.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_it.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_it.properties index ccdec8f989..6264aa3c26 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_it.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_it.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=Tutte le concessioni sono state te rmevent.WGI_action_complete=Azione WGI completata rmevent.separation=Separazione rmevent.case_complete=Caso completato +rmevent.declassification_review=Esame di declassificazione From 4382e40dc1bc33e001269eef4394d5a842f4d796 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:09:32 +0100 Subject: [PATCH 23/29] JAPANESE: Updated bundle based on EN-RM-rev2018-04-30T100445 --- .../messages/audit-service_ja.properties | 4 ++++ .../org_alfresco_module_rm/messages/rm-events_ja.properties | 1 + 2 files changed, 5 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ja.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ja.properties index b9e2573227..3a81eedbb8 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ja.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_ja.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=\u30ed\u30b0\u30a4\u30f3\u6210\u529f rm.audit.login-failed=\u30ed\u30b0\u30a4\u30f3\u5931\u6557 rm.audit.create-person=\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210 rm.audit.delete-person=\u30e6\u30fc\u30b6\u30fc\u306e\u524a\u9664 +rm.audit.create-userGroup=\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7\u306e\u4f5c\u6210 +rm.audit.delete-userGroup=\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7\u306e\u524a\u9664 +rm.audit.addMember=\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7\u306b\u8ffd\u52a0 +rm.audit.removeMember=\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7\u304b\u3089\u524a\u9664 rm.audit.linkTo=\u30ea\u30f3\u30af\u5148 rm.audit.moveTo=\u79fb\u52d5\u5148 rm.audit.copyTo=\u30b3\u30d4\u30fc\u5148 diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ja.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ja.properties index 50309fb68f..86d0efa00f 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ja.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ja.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=\u8a31\u53ef\u3055\u308c\u3066\u30 rmevent.WGI_action_complete=WGI \u51e6\u7406\u5b8c\u4e86 rmevent.separation=\u5206\u96e2 rmevent.case_complete=\u30b1\u30fc\u30b9\u5b8c\u4e86 +rmevent.declassification_review=\u5206\u985e\u89e3\u9664\u306e\u30ec\u30d3\u30e5\u30fc From 60b0187f5bbc8490581af8a319a6e194d2a774af Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:10:05 +0100 Subject: [PATCH 24/29] NORWEGIAN Bokmal: Updated bundle based on EN-RM-rev2018-04-30T100445 --- .../messages/audit-service_nb.properties | 4 ++++ .../org_alfresco_module_rm/messages/rm-events_nb.properties | 1 + 2 files changed, 5 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nb.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nb.properties index fd1fed24fb..c0189944e5 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nb.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_nb.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=Vellykket p\u00e5logging rm.audit.login-failed=Mislykket p\u00e5logging rm.audit.create-person=Opprett bruker rm.audit.delete-person=Slett bruker +rm.audit.create-userGroup=Opprett brukergruppe +rm.audit.delete-userGroup=Slett brukergruppe +rm.audit.addMember=Legg til i brukergruppe +rm.audit.removeMember=Fjern fra brukergruppe rm.audit.linkTo=Koble til rm.audit.moveTo=Flytt til rm.audit.copyTo=Kopier til diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nb.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nb.properties index e44b8d4bfa..a408568d85 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nb.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nb.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=Alle tillatelser som er gitt, er a rmevent.WGI_action_complete=WGI-handling fullf\u00f8rt rmevent.separation=Separasjon rmevent.case_complete=Sak fullf\u00f8rt +rmevent.declassification_review=Gjennomgang av deklassifisering From 22d43fa8e9a800f7a1c96b73bb12d0872648e6ab Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:10:36 +0100 Subject: [PATCH 25/29] DUTCH: Updated bundle based on EN-RM-rev2018-04-30T100445 --- .../org_alfresco_module_rm/messages/rm-events_nl.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nl.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nl.properties index 69c6ecfc3a..f1bf21b428 100755 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nl.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_nl.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=Alle toegekende rechten zijn be\u0 rmevent.WGI_action_complete=WGI-actie afgerond rmevent.separation=Scheiding rmevent.case_complete=Geval afgerond +rmevent.declassification_review=Classificatieopheffingsrevisie From 6446ab407d19dcf84113171ceca3aeb4915db5ba Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:11:13 +0100 Subject: [PATCH 26/29] RUSSIAN: Updated bundle based on EN-RM-rev2018-04-30T100445 --- .../org_alfresco_module_rm/messages/rm-events_ru.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ru.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ru.properties index 8dfbe318c5..fee3d91ea9 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ru.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_ru.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=\u0412\u0441\u0435 \u043f\u0440\u0 rmevent.WGI_action_complete=\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 WGI \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e rmevent.separation=\u0420\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 rmevent.case_complete=\u0421\u043b\u0443\u0447\u0430\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d +rmevent.declassification_review=\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0441\u0441\u0435\u043a\u0440\u0435\u0447\u0438\u0432\u0430\u043d\u0438\u044f From 36eaebe6aa4f1c1578132387693122f379442cce Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:11:49 +0100 Subject: [PATCH 27/29] BRAZILIAN Portuguese: Updated bundle based on EN-RM-rev2018-04-30T100445 --- .../org_alfresco_module_rm/messages/rm-events_pt_BR.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_pt_BR.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_pt_BR.properties index 75e88fd6fa..4a23145836 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_pt_BR.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_pt_BR.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=Todas as bonifica\u00e7\u00f5es co rmevent.WGI_action_complete=A\u00e7\u00e3o de WGI conclu\u00edda rmevent.separation=Separa\u00e7\u00e3o rmevent.case_complete=Caso conclu\u00eddo +rmevent.declassification_review=Revis\u00e3o de desclassifica\u00e7\u00e3o From 31d928b9d3d5b91d886d7f281b2a6fdecde2b4c5 Mon Sep 17 00:00:00 2001 From: gbroadbent Date: Mon, 30 Apr 2018 17:12:29 +0100 Subject: [PATCH 28/29] SIMPLIFIED CHINESE: Updated bundle based on EN-RM-rev2018-04-30T100445 --- .../messages/audit-service_zh_CN.properties | 4 ++++ .../messages/rm-events_zh_CN.properties | 1 + 2 files changed, 5 insertions(+) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_zh_CN.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_zh_CN.properties index 0b9cdf675f..494dd6ff77 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_zh_CN.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/audit-service_zh_CN.properties @@ -5,6 +5,10 @@ rm.audit.login-succeeded=\u767b\u5f55\u6210\u529f rm.audit.login-failed=\u767b\u5f55\u5931\u8d25 rm.audit.create-person=\u521b\u5efa\u7528\u6237 rm.audit.delete-person=\u5220\u9664\u7528\u6237 +rm.audit.create-userGroup=\u521b\u5efa\u7528\u6237\u7ec4 +rm.audit.delete-userGroup=\u5220\u9664\u7528\u6237\u7ec4 +rm.audit.addMember=\u52a0\u5230\u7528\u6237\u7ec4 +rm.audit.removeMember=\u4ece\u7528\u6237\u7ec4\u79fb\u9664 rm.audit.linkTo=\u94fe\u63a5\u5230 rm.audit.moveTo=\u79fb\u52a8\u5230 rm.audit.copyTo=\u590d\u5236\u5230 diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_zh_CN.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_zh_CN.properties index 628aef053e..dc778c1a1b 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_zh_CN.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/rm-events_zh_CN.properties @@ -20,3 +20,4 @@ rmevent.all_allowances_granted_are_terminated=\u6240\u6709\u6388\u4e88\u7684\u96 rmevent.WGI_action_complete=WGI \u64cd\u4f5c\u5b8c\u6210 rmevent.separation=\u5206\u79bb rmevent.case_complete=\u6848\u4f8b\u5b8c\u6210 +rmevent.declassification_review=\u53d6\u6d88\u5206\u7c7b\u7684\u5ba1\u67e5 From 49291704f46f15ed208a6feb0e30e5bd3ccaa27a Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Mon, 30 Apr 2018 21:00:40 +0300 Subject: [PATCH 29/29] RM-5234 Minor refactor. --- .../audit/RecordsManagementAuditServiceImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java index 6b46eb4e9c..35e7756bf5 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java @@ -1107,12 +1107,11 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean } else if (params.getEvent() != null) { - if (params.getEvent().equalsIgnoreCase("Login.Success")) + if (params.getEvent().equalsIgnoreCase(RM_AUDIT_EVENT_LOGIN_SUCCESS)) { auditQueryParams.addSearchKey(RM_AUDIT_DATA_LOGIN_FULLNAME, null); } - else - if (params.getEvent().equalsIgnoreCase("Login.Failure")) + else if (params.getEvent().equalsIgnoreCase(RM_AUDIT_EVENT_LOGIN_FAILURE)) { auditQueryParams.addSearchKey(RM_AUDIT_DATA_LOGIN_ERROR, null); }