for (Permission permissionEntity : permissionDAO.findGroupPermissions(akteraGroup))
{
Tuple2 aclKey = new Tuple2(permissionEntity.getObjectType() != null ? permissionEntity
.getObjectType() : GLOBAL_OBJECT_TYPE, permissionEntity.getObjectId());
Acl acl = aclByDomainObject.get(aclKey);
if (acl == null)
{
acl = new Acl(ROOT, ROOT_NAME);
aclByDomainObject.put(aclKey, acl);
}
AclEntry aclEntry = acl.findAclEntry(group, permissionEntity.getNegative());
if (aclEntry == null)
{
aclEntry = new AclEntry(group);
if (permissionEntity.getNegative())
{
aclEntry.setNegativePermissions();
}
acl.addEntry(ROOT, aclEntry);
}
aclEntry.addPermission(new SimplePermission(permissionEntity.getPermission()));
}
}
if (! group.isMember(principal))
{
group.addMember(principal);
}
}
for (Permission permissionEntity : permissionDAO.findUserPermissions(akteraUser))
{
Tuple2 aclKey = new Tuple2(permissionEntity.getObjectType() != null ? permissionEntity.getObjectType()
: GLOBAL_OBJECT_TYPE, permissionEntity.getObjectId());
Acl acl = aclByDomainObject.get(aclKey);
if (acl == null)
{
acl = new Acl(ROOT, ROOT_NAME);
aclByDomainObject.put(aclKey, acl);
}
AclEntry aclEntry = acl.findAclEntry(principal, permissionEntity.getNegative());
if (aclEntry == null)
{
aclEntry = new AclEntry(principal);
if (permissionEntity.getNegative())
{
aclEntry.setNegativePermissions();
}
acl.addEntry(ROOT, aclEntry);
}
aclEntry.addPermission(new SimplePermission(permissionEntity.getPermission()));
}
}
catch (NotOwnerException x)