Alfresco / alfresco-community-repo

Community Content Service Repository
https://www.alfresco.com/it/ecm-software/alfresco-community-edition
GNU Lesser General Public License v3.0
144 stars 82 forks source link

PermissionEventGenerator on enterprise repo events #601

Open fsforna opened 3 years ago

fsforna commented 3 years ago

Dear All, the org.alfresco.enterprise.repo.event2.PermissionEventGenerator produces permission generations event errors for deleted nodes (for example nodes deleted by repository behaviour logics).

In the public void afterCommit() method we reckon that you have to correct your code for example in this way:

for (Map.Entry<NodeRef, EnterpriseEventConsolidator> entry : consolidators.getPermissionChanges().entrySet()) { if (!nodeService.exists(entry.getKey())) { //ADDED CODE LOGGER.warn("Node " + entry.getKey() + " doesn't exist -- skipping event permission generation"); continue; } EnterpriseEventConsolidator eventConsolidator = entry.getValue(); sendEvent(entry.getKey(), eventConsolidator); sendChildrenEvents(entry.getKey()); }

Regards.

aborroy commented 2 years ago

@jesty This seems to be a valid report and still unsolved in latest version

AFaust commented 1 year ago

Interestingly, the sendChildrenEvents method does contain an exists-check for the node. It is just the sendEvent that does not check.