Commit 1c6bcfd9 authored by Matija Obreza's avatar Matija Obreza

Merge branch '28-first-delete-issue' into 'master'

Resolve "First delete issue"

Closes #28

See merge request genesys-pgr/application-blocks!30
parents 3b1a22fd 8c98d112
......@@ -18,6 +18,8 @@ package org.genesys.blocks.security.service.impl;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import org.genesys.blocks.security.SecurityContextUtil;
import org.genesys.blocks.security.model.AclAwareModel;
import org.genesys.blocks.security.model.AclClass;
......@@ -73,6 +75,10 @@ public class CustomAclServiceImpl implements CustomAclService {
@Autowired
private AclSidPersistence aclSidPersistence;
/** The entity manager. */
@Autowired
private EntityManager entityManager;
static {
basePermissions = new Permission[] { BasePermission.CREATE, BasePermission.READ, BasePermission.WRITE, BasePermission.DELETE, BasePermission.ADMINISTRATION };
}
......@@ -382,6 +388,7 @@ public class CustomAclServiceImpl implements CustomAclService {
if (!aclEntries.isEmpty()) {
LOG.info("Deleting " + aclEntries);
aclEntryPersistence.delete(aclEntries);
entityManager.flush();
}
return getObjectIdentity(objectIdentity.getId());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment