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