Commit 8b36e96d authored by Matija Obreza's avatar Matija Obreza
Browse files

@Transactional does nothing on private methods, TODOs for issue

parent 2906a1d7
......@@ -45,10 +45,12 @@ public class AclAssignerAspect {
needsAcl = true;
}
}
// TODO What about collections of AclAwareModel?
}
try {
if (needsAcl) {
// TODO What about collections of AclAwareModel?
final AclAwareModel aclModel = (AclAwareModel) result;
LOG.debug("Inserting ACL entries for owner={}", aclModel.getId());
aclService.addCreatorPermissions(aclModel);
......@@ -74,6 +76,7 @@ public class AclAssignerAspect {
LOG.debug("Removing ACL entries for model={}", aclModel);
aclService.removePermissions(aclModel);
}
// TODO What about collections of AclAwareModel?
} finally {
// Nothing to do here
}
......
......@@ -56,7 +56,7 @@ public class CustomAclServiceImpl implements CustomAclService {
private static final Logger LOG = LoggerFactory.getLogger(CustomAclServiceImpl.class);
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Transactional(propagation = Propagation.REQUIRED)
public void addCreatorPermissions(final AclAwareModel target) {
if (target == null) {
LOG.warn("No target specified for ACL permissions, bailing out!");
......@@ -96,7 +96,7 @@ public class CustomAclServiceImpl implements CustomAclService {
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Transactional(propagation = Propagation.REQUIRED)
public void removePermissions(final AclAwareModel target) {
final AclObjectIdentity savedAclObjectIdentity = aclObjectIdentityPersistence.findByObjectIdIdentityAndClassName((Long) target.getId(), target.getClass().getName());
if (savedAclObjectIdentity != null) {
......@@ -108,7 +108,6 @@ public class CustomAclServiceImpl implements CustomAclService {
}
}
@Transactional
private void addPermissions(final AclSid ownerSid, final AclObjectIdentity objectIdentity, final Map<Integer, Boolean> permissions) {
// create Acl Entry
for (final Permission permission : basePermissions) {
......@@ -141,7 +140,6 @@ public class CustomAclServiceImpl implements CustomAclService {
return maxAceOrder != null ? maxAceOrder + 1 : 1;
}
@Transactional
private AclClass ensureAclClass(final String className) {
AclClass aclClass = aclClassPersistence.findByAclClass(className);
......@@ -155,7 +153,6 @@ public class CustomAclServiceImpl implements CustomAclService {
return aclClass;
}
@Transactional
private AclSid ensureSid(final String uuid, final boolean principal) {
AclSid aclSid = aclSidPersistence.findBySidAndPrincipal(uuid, principal);
......
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