}
protected AccessControlList initAcl(AccessControlList parentACL, boolean isOwneable, boolean isPrivilegeable,
String owner, List<String> exoPermissions)
{
AccessControlList acl;
if (isOwneable)
{
// has own owner
if (isPrivilegeable)
{
// and permissions
acl = new AccessControlList(owner, readACLPermisions(exoPermissions));
}
else if (parentACL != null)
{
// use permissions from existed parent
acl = new AccessControlList(owner, parentACL.hasPermissions() ? parentACL.getPermissionEntries() : null);
}
else
{
// have to search nearest ancestor permissions in ACL manager
// acl = new AccessControlList(owner,
// traverseACLPermissions(cpid));
acl = new AccessControlList(owner, null);
}
}
else if (isPrivilegeable)
{
// has own permissions
if (isOwneable)
{
// and owner
acl = new AccessControlList(owner, readACLPermisions(exoPermissions));
}
else if (parentACL != null)
{
// use owner from existed parent
acl = new AccessControlList(parentACL.getOwner(), readACLPermisions(exoPermissions));
}
else
{
// have to search nearest ancestor owner in ACL manager
// acl = new AccessControlList(traverseACLOwner(cpid),
// readACLPermisions(cid));
acl = new AccessControlList(null, readACLPermisions(exoPermissions));
}
}
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;