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