Commit 03dc333d authored by Matija Obreza's avatar Matija Obreza
Browse files

Fixed bug in #ensureObjectIdentity using user email instead of uuid

parent 7b55e2a0
...@@ -38,10 +38,10 @@ public class AclAssignerAspect { ...@@ -38,10 +38,10 @@ public class AclAssignerAspect {
boolean needsAcl = false; boolean needsAcl = false;
final Authentication auth = SecurityContextHolder.getContext().getAuthentication(); final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (auth != null) {
if (result instanceof AclAwareModel) { if (result instanceof AclAwareModel) {
final AclAwareModel aclModel = (AclAwareModel) result; final AclAwareModel aclModel = (AclAwareModel) result;
if (aclModel.getId() != null) { if (aclModel.getId() != null) {
if (auth != null) {
needsAcl = true; needsAcl = true;
} }
} }
...@@ -50,7 +50,7 @@ public class AclAssignerAspect { ...@@ -50,7 +50,7 @@ public class AclAssignerAspect {
try { try {
if (needsAcl) { if (needsAcl) {
final AclAwareModel aclModel = (AclAwareModel) result; final AclAwareModel aclModel = (AclAwareModel) result;
LOG.trace("Inserting ACL entries for owner={}", aclModel.getId()); LOG.debug("Inserting ACL entries for owner={}", aclModel.getId());
aclService.addCreatorPermissions(aclModel); aclService.addCreatorPermissions(aclModel);
} }
return result; return result;
...@@ -71,7 +71,7 @@ public class AclAssignerAspect { ...@@ -71,7 +71,7 @@ public class AclAssignerAspect {
try { try {
if (arg0 instanceof AclAwareModel) { if (arg0 instanceof AclAwareModel) {
final AclAwareModel aclModel = (AclAwareModel) arg0; final AclAwareModel aclModel = (AclAwareModel) arg0;
LOG.trace("Removing ACL entries for model={}", aclModel); LOG.debug("Removing ACL entries for model={}", aclModel);
aclService.removePermissions(aclModel); aclService.removePermissions(aclModel);
} }
} finally { } finally {
......
...@@ -146,7 +146,7 @@ public class CustomAclServiceImpl implements CustomAclService { ...@@ -146,7 +146,7 @@ public class CustomAclServiceImpl implements CustomAclService {
AclClass aclClass = aclClassPersistence.findByAclClass(className); AclClass aclClass = aclClassPersistence.findByAclClass(className);
if (aclClass == null) { if (aclClass == null) {
LOG.warn("Missing AclClass..."); LOG.warn("Missing AclClass '{}'", className);
aclClass = new AclClass(); aclClass = new AclClass();
aclClass.setAclClass(className); aclClass.setAclClass(className);
return aclClassPersistence.save(aclClass); return aclClassPersistence.save(aclClass);
...@@ -166,7 +166,7 @@ public class CustomAclServiceImpl implements CustomAclService { ...@@ -166,7 +166,7 @@ public class CustomAclServiceImpl implements CustomAclService {
aclSid.setSid(uuid); aclSid.setSid(uuid);
// save it into db // save it into db
LOG.warn("New SID " + aclSid); LOG.warn("New SID sid={} principal={}", aclSid.getSid(), aclSid.isPrincipal());
return aclSidPersistence.save(aclSid); return aclSidPersistence.save(aclSid);
} }
...@@ -292,7 +292,7 @@ public class CustomAclServiceImpl implements CustomAclService { ...@@ -292,7 +292,7 @@ public class CustomAclServiceImpl implements CustomAclService {
aoi.setObjectIdIdentity(objectIdIdentity); aoi.setObjectIdIdentity(objectIdIdentity);
aoi.setAclClass(ensureAclClass(className)); aoi.setAclClass(ensureAclClass(className));
// System user UUID // System user UUID
final String uuid = SecurityContextUtil.getMe().getEmail(); final String uuid = SecurityContextUtil.getMe().getUuid();
final AclSid ownerSid = ensureSid(uuid, true); final AclSid ownerSid = ensureSid(uuid, true);
aoi.setOwnerSid(ownerSid); aoi.setOwnerSid(ownerSid);
aoi = aclObjectIdentityPersistence.save(aoi); aoi = aclObjectIdentityPersistence.save(aoi);
......
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