// MIXIN
MixinInfo mixins = readMixins(cid);
// ACL
AccessControlList acl; // NO DEFAULT values!
if (mixins.hasOwneable())
{
// has own owner
if (mixins.hasPrivilegeable())
{
// and permissions
acl = new AccessControlList(readACLOwner(cid), readACLPermisions(cid));
}
else if (parentACL != null)
{
// use permissions from existed parent
acl =
new AccessControlList(readACLOwner(cid), parentACL.hasPermissions()
? parentACL.getPermissionEntries() : null);
}
else
{
// have to search nearest ancestor permissions in ACL manager
// acl = new AccessControlList(readACLOwner(cid), traverseACLPermissions(cpid));
acl = new AccessControlList(readACLOwner(cid), null);
}
}
else if (mixins.hasPrivilegeable())
{
// has own permissions
if (mixins.hasOwneable())
{
// and owner
acl = new AccessControlList(readACLOwner(cid), readACLPermisions(cid));
}
else if (parentACL != null)
{
// use owner from existed parent
acl = new AccessControlList(parentACL.getOwner(), readACLPermisions(cid));
}
else
{
// have to search nearest ancestor owner in ACL manager
// acl = new AccessControlList(traverseACLOwner(cpid), readACLPermisions(cid));
acl = new AccessControlList(null, readACLPermisions(cid));
}
}
else
{
if (parentACL != null)
// construct ACL from existed parent ACL
acl =
new AccessControlList(parentACL.getOwner(), parentACL.hasPermissions()
? parentACL.getPermissionEntries() : null);
else
// have to search nearest ancestor owner and permissions in ACL manager
// acl = traverseACL(cpid);
acl = null;